Пример #1
0
        private bool EditGameObjectInternal(GameObject gameObject, IAnimationWindowControl controlInterface)
        {
            bool result;

            if (EditorUtility.IsPersistent(gameObject))
            {
                result = false;
            }
            else if ((gameObject.hideFlags & HideFlags.NotEditable) != HideFlags.None)
            {
                result = false;
            }
            else
            {
                GameObjectSelectionItem gameObjectSelectionItem = GameObjectSelectionItem.Create(gameObject);
                if (this.ShouldUpdateGameObjectSelection(gameObjectSelectionItem))
                {
                    this.m_AnimEditor.selectedItem             = gameObjectSelectionItem;
                    this.m_AnimEditor.overrideControlInterface = controlInterface;
                    result = true;
                }
                else
                {
                    UnityEngine.Object.DestroyImmediate(gameObjectSelectionItem);
                    result = false;
                }
            }
            return(result);
        }
Пример #2
0
        private bool EditGameObjectInternal(GameObject gameObject, IAnimationWindowControl controlInterface)
        {
            if (EditorUtility.IsPersistent(gameObject))
            {
                return(false);
            }

            if ((gameObject.hideFlags & HideFlags.NotEditable) != 0)
            {
                return(false);
            }

            var newSelection = GameObjectSelectionItem.Create(gameObject);

            if (ShouldUpdateGameObjectSelection(newSelection))
            {
                m_AnimEditor.selection = newSelection;
                m_AnimEditor.overrideControlInterface = controlInterface;

                m_LastSelectedObjectID = gameObject != null?gameObject.GetInstanceID() : 0;
            }
            else
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
        private bool EditGameObjectInternal(GameObject gameObject, IAnimationWindowControl controlInterface)
        {
            bool result;

            if (EditorUtility.IsPersistent(gameObject))
            {
                result = false;
            }
            else if ((gameObject.hideFlags & HideFlags.NotEditable) != HideFlags.None)
            {
                result = false;
            }
            else
            {
                GameObjectSelectionItem gameObjectSelectionItem = GameObjectSelectionItem.Create(gameObject);
                if (this.ShouldUpdateGameObjectSelection(gameObjectSelectionItem))
                {
                    this.m_AnimEditor.selection = gameObjectSelectionItem;
                    this.m_AnimEditor.overrideControlInterface = controlInterface;
                    this.m_LastSelectedObjectID = ((!(gameObject != null)) ? 0 : gameObject.GetInstanceID());
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }
Пример #4
0
 public void EditGameObject(GameObject gameObject)
 {
     if (!EditorUtility.IsPersistent(gameObject) && ((gameObject.hideFlags & HideFlags.NotEditable) == HideFlags.None))
     {
         GameObjectSelectionItem selectedItem = GameObjectSelectionItem.Create(gameObject);
         if (this.ShouldUpdateSelection(selectedItem))
         {
             this.m_AnimEditor.state.recording = false;
             this.m_AnimEditor.selectedItem    = selectedItem;
         }
         else
         {
             UnityEngine.Object.DestroyImmediate(selectedItem);
         }
     }
 }