Ejemplo n.º 1
0
        void Awake()
        {
            ClayContainer container = this.getClayContainer();

            if (container != null)
            {
                container.scheduleClayObjectsScan();
            }
        }
Ejemplo n.º 2
0
        public void init()
        {
            this.solids.Clear();
            this.changeNumSolids(this.numSolids);
            this.transform.hasChanged = true;

            ClayContainer oldContainer = null;

            if (this.clayxelContainerRef != null)
            {
                oldContainer = (ClayContainer)this.clayxelContainerRef.Target;
            }

            this.clayxelContainerRef = null;
            if (this.transform.parent == null)
            {
                return;
            }

            GameObject parent = this.transform.parent.gameObject;

            ClayContainer clayxel = null;

            for (int i = 0; i < 100; ++i)
            {
                clayxel = parent.GetComponent <ClayContainer>();
                if (clayxel != null)
                {
                    break;
                }
                else
                {
                    parent = parent.transform.parent.gameObject;
                }
            }

            if (clayxel == null)
            {
                Debug.Log("failed to find parent clayxel container");
            }
            else
            {
                this.clayxelContainerRef = new WeakReference(clayxel);

                if (oldContainer != null && oldContainer != clayxel)
                {
                    clayxel.scheduleClayObjectsScan();
                }
            }

                        #if UNITY_EDITOR
            Undo.undoRedoPerformed += this.onUndoPerformed;
                        #endif
        }
Ejemplo n.º 3
0
        void OnDestroy()
        {
            this.invalidated = true;

            ClayContainer clayxel = this.getClayContainer();

            if (clayxel != null)
            {
                clayxel.scheduleClayObjectsScan();

                                #if UNITY_EDITOR
                if (!Application.isPlaying)
                {
                    UnityEditor.EditorApplication.QueuePlayerLoopUpdate();
                }
                                #endif
            }
        }
Ejemplo n.º 4
0
        void OnDestroy()
        {
            this.invalidated = true;
            this.enabled     = false;

            ClayContainer clayxel = this.getClayContainer();

            if (clayxel != null)
            {
                clayxel.scheduleClayObjectsScan();

                                #if UNITY_EDITOR
                if (!Application.isPlaying)
                {
                    UnityEditor.EditorApplication.QueuePlayerLoopUpdate();
                }
                                #endif
            }

                        #if UNITY_EDITOR
            Undo.undoRedoPerformed -= this.onUndoPerformed;
                        #endif
        }