示例#1
0
        void UpdateOwnerTrans(Transform trans)
        {
            if (mComponent == null)
            {
                mComponent = trans.gameObject.AddComponent <UI3DTargetGuide>();
            }

            mComponent.SetOwnerTrans(trans);
            mComponent.ResetStyleInfo(mStyleInfo);
        }
示例#2
0
        public override void UnInitBehaviors()
        {
            mOwner.UnsubscribeActorEvent(Actor.ActorEvent.AFTER_CREATE, OnAfterCreate);
            mOwner.UnsubscribeActorEvent(Actor.ActorEvent.MODEL_CHANGE, OnModelChange);
            mOwner.UnsubscribeActorEvent(Actor.ActorEvent.RES_LOADED_CHANGE, OnModelChange);
            base.UnInitBehaviors();

            if (null != mComponent)
            {
                UnityEngine.GameObject.Destroy(mComponent);
                mComponent = null;
            }
        }