private void DrawTweenerProperties(UITweener tweener)
    {
        if (showGroup && (group == tweener.tweenGroup))
        {
            GUI.color = new Color(1, 1, 0, 1);
        }

        GUILayout.BeginVertical("box");
        GUI.color = Color.white;
        GUILayout.BeginHorizontal();
        GUILayout.Label("GameObject", GUILayout.Width(80f));
        EditorGUILayout.TextField(tweener.gameObject.name);
        if (GUILayout.Button("Locate", "PreButton"))
        {
            Selection.activeGameObject = tweener.gameObject;
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("TweenType", GUILayout.Width(80f));
        EditorGUILayout.TextField(tweener.GetType().Name);
        GUILayout.Label(new GUIContent("Tween Group", "可以直接在此更改"), GUILayout.Width(80f));
        tweener.tweenGroup = EditorGUILayout.IntField(tweener.tweenGroup, GUILayout.Width(30f));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();

        if (GUILayout.Button(!tweener.isPlay ? "Play" : "Pause", "ButtonLeft"))
        {
            isPlay = false;
            tweener.OnPlayOrPause(!tweener.isPlay);
        }
        if (GUILayout.Button("Restart", "ButtonMid"))
        {
            tweener.OnRestart();
        }
        if (GUILayout.Button("Stop", "ButtonRIght"))
        {
            tweener.OnStop();
        }

        GUILayout.EndHorizontal();
        GUILayout.EndVertical();

        GUI.color = Color.white;
    }
Exemplo n.º 2
0
    protected void DrawNodeWindow(int id)
    {
        GUILayout.BeginHorizontal();

        if (GUILayout.Button(!tweener.isPlay ? "Play" : "Pause", "ButtonLeft"))
        {
            tweener.OnPlayOrPause(!tweener.isPlay);
        }
        if (GUILayout.Button("Restart", "ButtonMid"))
        {
            tweener.OnRestart();
        }
        if (GUILayout.Button("Stop", "ButtonRIght"))
        {
            tweener.OnStop();
        }

        GUILayout.EndHorizontal();

        GUILayout.Label("预览无视“Ignore TimeScale”选项");
    }