Exemplo n.º 1
0
 private void ApplyGravity(GameObject target, float delta, SkillAnimInfo animInfo)
 {
     if (target == null)
     {
         return;
     }
     if (!Script_Util.IsOnGround(target, GroundTweak))
     {
         StartControlGravity();
         m_Vertical += Gravity * delta;
         Vector3   posOff     = m_Vertical * delta;
         Vector3   pos        = target.transform.position + posOff;
         Component controller = target.GetComponent <CharacterController>();
         if (controller != null)
         {
             ((CharacterController)controller).Move(posOff);
         }
         else
         {
             target.transform.position += posOff;
         }
         LogicSystem.NotifyGfxUpdatePosition(target, pos.x, pos.y, pos.z);
     }
     else
     {
         EndControlGravity();
     }
 }