コード例 #1
0
 private void Jump()
 {
     if (Input.GetKeyDown(KeyCode.Space) && !isDoubleJump)
     {
         Debug.Log(TotalScript.GetGravity());
         if (!TotalScript.GetGravity())
         {
             rb.AddForce(new Vector2(0, jumpForce));
             animator.SetBool("IsJump", true);
             animator.SetBool("IsOnLadderUp", false);
             animator.SetBool("IsOnLadderDown", false);
         }
         else
         {
             rb.AddForce(new Vector2(0, -jumpForce));
             animator.SetBool("IsJump", true);
             animator.SetBool("IsOnLadderUp", false);
             animator.SetBool("IsOnLadderDown", false);
         }
         if (isGrounded == false)
         {
             isDoubleJump = true;
         }
         isGrounded = false;
     }
 }
コード例 #2
0
ファイル: CharacterFlip.cs プロジェクト: s18591/GameJam
 public void  Update()
 {
     if (isNormalRotation != TotalScript.GetGravity())
     {
         isNormalRotation = TotalScript.GetGravity();
         TotalScript.GravityFlip(gameObject);
     }
 }
コード例 #3
0
 private void Update()
 {
     if (shield != null && !TotalScript.GetGravity())
     {
         shield.GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0);
     }
     else if (shield != null && TotalScript.GetGravity())
     {
         shield.GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 1);
     }
     if (isOnCooldown)
     {
         timer += Time.deltaTime;
         if (timer >= attackDelay)
         {
             timer        = 0;
             isOnCooldown = false;
             if (coolDownObject != null)
             {
                 coolDownObject.GetComponent <SpriteRenderer>().color = new Color(1, 0, 1, 1);
             }
         }
     }
 }
コード例 #4
0
ファイル: CharacterFlip.cs プロジェクト: s18591/GameJam
 public void Start()
 {
     isNormalRotation = TotalScript.GetGravity();
 }