コード例 #1
0
 private void GenerateHandIK()
 {
     if (this.animator != null && this.animator.isHuman)
     {
         this.handIK = this.animator.gameObject.AddComponent <CharacterHandIK>();
     }
 }
コード例 #2
0
        // 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);
        }