示例#1
0
        /// <summary>
        /// Raised when we release the lock on a target
        /// </summary>
        protected virtual void OnTargetUnlocked(Transform rTransform)
        {
            if (_UnlockCameraMode >= 0)
            {
                if (mMotionController != null && mMotionController.CameraRig != null)
                {
                    mMotionController.CameraRig.Mode = _UnlockCameraMode;
                }
            }

            if (TargetUnlocked != null)
            {
                TargetUnlocked(this, rTransform);
            }

            // Send the message
            CombatMessage lMessage = CombatMessage.Allocate();

            lMessage.ID       = EnumMessageID.MSG_COMBAT_ATTACKER_TARGET_UNLOCKED;
            lMessage.Attacker = gameObject;
            lMessage.Defender = rTransform.gameObject;

            if (TargetUnlockedEvent != null)
            {
                TargetUnlockedEvent.Invoke(lMessage);
            }

#if USE_MESSAGE_DISPATCHER || OOTII_MD
            MessageDispatcher.SendMessage(lMessage);
#endif

            CombatMessage.Release(lMessage);
        }