Пример #1
0
        /// <summary>
        /// 配置旋转
        /// </summary>
        void setupRotation(RuntimeCharacter.Direction d)
        {
            var rot = transform.localEulerAngles;

            rot.z = RuntimeCharacter.dir82Angle(d);
            transform.localEulerAngles = rot;
        }
Пример #2
0
 /// <summary>
 /// 朝一个方向移动
 /// </summary>
 /// <param name="d"></param>
 public void moveDirection(
     RuntimeCharacter.Direction d,
     float speed = -1, bool force = false)
 {
     if (speed < 0)
     {
         speed = moveSpeed();
     }
     runtimeCharacter?.moveDirection(d, speed, force);
     //refreshFacing(d);
 }
Пример #3
0
        public void activate(SkillProcessor skill,
                             RuntimeCharacter.Direction d)
        {
            debugLog("activate: " + d);

            skillProcessor = skill;

            setupPosition();
            setupRotation(d);
            setupVelocity(d);

            activate();
        }
Пример #4
0
        /// <summary>
        /// 配置速度
        /// </summary>
        void setupVelocity(RuntimeCharacter.Direction d)
        {
            var vec = RuntimeCharacter.dir82Vec(d);

            rigidbody.velocity = vec * speed;
        }