private void GenerateHandIK() { if (this.animator != null && this.animator.isHuman) { this.handIK = this.animator.gameObject.AddComponent <CharacterHandIK>(); } }
// EXECUTABLE: ---------------------------------------------------------------------------- public override bool InstantExecute(GameObject target, IAction[] actions, int index) { Character characterTarget = this.character.GetCharacter(target); if (characterTarget == null) { return(true); } CharacterAnimator animator = characterTarget.GetCharacterAnimator(); if (animator == null) { return(true); } CharacterHandIK handIK = animator.GetCharacterHandIK(); if (handIK == null) { return(true); } switch (this.action) { case Action.Reach: handIK.Reach( this.hand, this.reachTarget.GetTransform(target), this.duration ); break; case Action.LetGo: handIK.LetGo(this.hand, this.duration); break; } return(true); }