Beispiel #1
0
        void OnSelect(Object selected)
        {
            if (Application.isPlaying)
            {
                return;
            }

            if (selected is GameObject go)
            {
                if (string.IsNullOrEmpty(go.scene.name))
                {
                    ChangeDirector(null);
                    return;
                }

                var director = go.GetComponent <IDirector>();
                ChangeDirector(director);
                return;
            }

            if (selected is SequenceBehaviour sequence)
            {
                ChangeDirector(EditorDirector.Create(sequence));
                return;
            }
        }
        public static EditorDirector Create(SequenceBehaviour sequence)
        {
            var director = new EditorDirector();

            director.m_Sequence = sequence;
            return(director);
        }