public override void execute() { ComponentOwner obj = mReceiver as ComponentOwner; ComponentTrackTargetPhysics component = obj.getComponent(out component); // 停止其他移动组件 obj.breakComponent <IComponentModifyPosition>(component.GetType()); component.setSpeed(mSpeed); component.setTargetOffset(mOffset); component.setActive(true); component.setMoveDoneTrack(mTarget, mDoneCallback); component.setTrackingCallback(mTrackingCallback); }
public override void execute() { Transformable obj = mReceiver as Transformable; ComponentTrackTargetPhysics component = obj.getComponent(out component); // 停止其他移动组件 obj.breakComponent <IComponentModifyPosition>(component.GetType()); component.setSpeed(mSpeed); component.setTargetOffset(mOffset); component.setActive(true); component.setMoveDoneTrack(mTarget, mDoneCallback); component.setTrackingCallback(mTrackingCallback); // 需要启用组件更新时,则开启组件拥有者的更新,后续也不会再关闭 obj.setEnable(true); }