Ejemplo n.º 1
0
        private void DeleteAllFiguresAndClearScript()
        {
            CCTotemPole script = this.Script;

            this.Script = null;
            for (int i = this.Configuration.numRequiredTotemicFigures - 1; i >= 0; i--)
            {
                CCTotem.TotemicFigure totemicFigures = this.TotemicFigures[i];
                if (!object.ReferenceEquals(totemicFigures, null))
                {
                    if (totemicFigures.TotemPole != this)
                    {
                        this.TotemicFigures[i] = null;
                    }
                    else
                    {
                        this.TotemicFigures[i].Delete(script);
                    }
                }
            }
            CCTotem.DestroyCCDesc(script, ref this.CCDesc);
            if (script && object.ReferenceEquals(script.totemicObject, this))
            {
                script.totemicObject = null;
            }
        }
Ejemplo n.º 2
0
        internal void Delete(CCTotemPole OwnerScript)
        {
            CCTotemicFigure script = this.Script;

            this.Script = null;
            if (script && object.ReferenceEquals(script.totemicObject, this))
            {
                script.totemicObject = null;
            }
            CCTotem.DestroyCCDesc(OwnerScript, ref this.CCDesc);
            if (script)
            {
                UnityEngine.Object.Destroy(script.gameObject);
            }
            if (object.ReferenceEquals(this.TotemPole.TotemicFigures[this.BottomUpIndex], this))
            {
                this.TotemPole.TotemicFigures[this.BottomUpIndex] = null;
            }
        }