浏览代码

Disabled PlayFromHere in toolbar if irrelevant / Flash Green Link Lock in lecked scene view's toolbar

/main
Thomas ICHÉ 6 年前
当前提交
40143a2a
共有 2 个文件被更改,包括 30 次插入9 次删除
  1. 7
      Editor/PlayFromHere.cs
  2. 32
      Editor/SceneViewToolbar.cs

7
Editor/PlayFromHere.cs


EditorApplication.playModeStateChanged += OnEnterPlayMode;
}
public static bool IsReady
{
get
{
return OnPlayFromHere != null && OnPlayFromHere.GetInvocationList().Length > 0;
}
}
public static void Play()
{

32
Editor/SceneViewToolbar.cs


{
using (new GUILayout.HorizontalScope(EditorStyles.toolbar))
{
bool play = GUILayout.Toggle(EditorApplication.isPlaying, Contents.playFromHere, EditorStyles.toolbarButton);
if(GUI.changed)
if(PlayFromHere.IsReady)
if (play)
PlayFromHere.Play();
else
EditorApplication.isPlaying = false;
bool play = GUILayout.Toggle(EditorApplication.isPlaying, Contents.playFromHere, EditorStyles.toolbarButton);
if(GUI.changed)
{
if (play)
PlayFromHere.Play();
else
EditorApplication.isPlaying = false;
}
GUILayout.Space(24);
GUILayout.Space(24);
Color backup = GUI.color;
bool isLocked = LinkGameView.LockedSceneView == sceneView;
if(isLinked && isLocked)
{
GUI.color = Color.green *2;
}
isLinked = GUILayout.Toggle(isLinked, Contents.linkGameView, EditorStyles.toolbarButton, GUILayout.Width(64));
if (GUI.changed)

bool isLocked = LinkGameView.LockedSceneView == sceneView;
isLocked = GUILayout.Toggle(isLocked, Contents.lockLinkGameView, EditorStyles.toolbarButton);
if (GUI.changed)

LinkGameView.LockedSceneView = null;
}
}
GUI.color = backup;
GUILayout.FlexibleSpace();

正在加载...
取消
保存