/// <summary> /// Called to start the specific motion. If the motion /// were something like 'jump', this would start the jumping process /// </summary> /// <param name="rPrevMotion">Motion that this motion is taking over from</param> public override bool Activate(MotionControllerMotion rPrevMotion) { mIsEquipped = false; // Tell the actor controller about our stance (in case the motion was forced) mActorController.State.Stance = EnumControllerStance.SPELL_CASTING; // If we already have equipment in hand, we don't need to run this motion if (mInventorySource != null) { string lItemID = (_OverrideItemID != null && _OverrideItemID.Length > 0 ? _OverrideItemID : _ItemID); string lSlotID = (_OverrideSlotID != null && _OverrideSlotID.Length > 0 ? _OverrideSlotID : _SlotID); string lEquippedItemID = mInventorySource.GetItemID(lSlotID); if (lEquippedItemID != null && lEquippedItemID.Length > 0) { if (lItemID != null && lItemID.Length > 0 && lItemID == lEquippedItemID) { return(false); } } } // Trigger the animation mMotionController.SetAnimatorMotionPhase(mMotionLayer.AnimatorLayerIndex, PHASE_START, true); return(base.Activate(rPrevMotion)); }
/// <summary> /// Called to start the specific motion. If the motion /// were something like 'jump', this would start the jumping process /// </summary> /// <param name="rPrevMotion">Motion that this motion is taking over from</param> public override bool Activate(MotionControllerMotion rPrevMotion) { mIsEquipped = false; // If we already have equipment in hand, we don't need to run this motion string lItemID = (_OverrideItemID != null && _OverrideItemID.Length > 0 ? _OverrideItemID : _ItemID); string lSlotID = (_OverrideSlotID != null && _OverrideSlotID.Length > 0 ? _OverrideSlotID : _SlotID); string lEquippedItemID = mInventorySource.GetItemID(lSlotID); if (lEquippedItemID != null && lEquippedItemID.Length > 0) { if (lItemID != null && lItemID.Length > 0 && lItemID == lEquippedItemID) { return(false); } } // Trigger the animation mMotionController.SetAnimatorMotionPhase(mMotionLayer.AnimatorLayerIndex, PHASE_START, _Form, 0, true); return(base.Activate(rPrevMotion)); }