Пример #1
0
 private void Awake()
 {
     rb       = GetComponent <Rigidbody2D>();
     colls    = GetComponentInParent <Collisions>();
     animator = GetComponentInChildren <Animator>();
     pch      = GetComponent <PlayerControlHelper>();
     movement = GetComponent <Move>();
     colls.playerListenOnFloorCallBack = (isOnFloor) => {
         //if (isOnFloor == true && Mathf.Abs(rb.velocity.y) < 0.1f )
         //只有变化才能进入
         if (isOnFloor == true)
         {
             //到达地面
             canDoubleJumped        = true;
             movement.isXOutControl = false;
         }
         else
         {
             //离开地面
             if (rb.velocity.y < 0)
             {
                 //下坠
                 pch.StartCounterJumpfalldownHelpTimer();
                 animator.SetBool("IsSilde", false);
             }
         }
     };
     colls.playerListenOnWallCallBack = (isOnWall) => {
         //只有变化才能进入
         if (isOnWall == true)
         {
             //到达墙壁
             canDoubleJumped = true;
         }
     };
 }
Пример #2
0
 private void Awake()
 {
     animator = GetComponentInChildren <Animator>();
     pch      = GetComponent <PlayerControlHelper>();
 }