void UpdateOwnerTrans(Transform trans) { if (mComponent == null) { mComponent = trans.gameObject.AddComponent <UI3DTargetGuide>(); } mComponent.SetOwnerTrans(trans); mComponent.ResetStyleInfo(mStyleInfo); }
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; } }