浏览代码

Base work on SceneView Toolbar

/main
Thomas ICHÉ 6 年前
当前提交
a30bcd47
共有 3 个文件被更改,包括 60 次插入2 次删除
  1. 4
      Editor/GameViewLink/LinkGameView.cs
  2. 47
      Editor/SceneViewToolbar.cs
  3. 11
      Editor/SceneViewToolbar.cs.meta

4
Editor/GameViewLink/LinkGameView.cs


namespace GameplayIngredients.Editor
{
static class LinkGameView
public static class LinkGameView
static bool Active
public static bool Active
{
get
{

47
Editor/SceneViewToolbar.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System;
namespace GameplayIngredients.Editor
{
static class SceneViewToolbar
{
[InitializeOnLoadMethod]
static void Initialize()
{
SceneView.onSceneGUIDelegate += OnSceneGUI;
}
private static void OnSceneGUI(SceneView sceneView)
{
var r = new Rect(Vector2.zero, new Vector2(sceneView.position.width,24));
using (new GUILayout.AreaScope(r))
{
using (new GUILayout.HorizontalScope(EditorStyles.toolbar))
{
bool link = LinkGameView.Active;
link = GUILayout.Toggle(link, "Link Game View", EditorStyles.toolbarButton);
if (GUI.changed)
LinkGameView.Active = link;
GUILayout.FlexibleSpace();
}
}
}
static class Styles
{
public static GUIStyle toolbar;
static Styles()
{
toolbar = new GUIStyle(EditorStyles.inspectorFullWidthMargins);
}
}
}
}

11
Editor/SceneViewToolbar.cs.meta


fileFormatVersion: 2
guid: ae60b154e719ca941ba3d0bd03137322
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存