示例#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
 public void  Update()
 {
     if (isNormalRotation != TotalScript.GetGravity())
     {
         isNormalRotation = TotalScript.GetGravity();
         TotalScript.GravityFlip(gameObject);
     }
 }
示例#3
0
 public void slotMeth()
 {
     if (!TotalScript.getLocked())
     {
         Text numberText = GetComponentInChildren <Text>();
         int  value;
         int.TryParse(numberText.text, out value);
         TotalScript.setTotalValue(value);
         this.gameObject.GetComponent <Image>().color = Color.green;
         TotalScript.setLocked(true);
         numberText.text = "0";
     }
 }
示例#4
0
    public void generate()
    {
        int value = SliderScript.getSliderValue();

        TotalScript.setTotalValue(-value);
        for (int i = 0; i < value; i++)
        {
            Text t = WoodenBoxesScript.getNumberBoxValue(i);
            t.text = (Random.Range(0, 10)).ToString();
        }
        TotalScript.setLocked(false);
        turno++;
        turnoText.text = "Turnos decorridos: " + turno.ToString();
        GameController.setTurnoValue(turno);
    }
示例#5
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);
             }
         }
     }
 }
示例#6
0
 public void Start()
 {
     isNormalRotation = TotalScript.GetGravity();
 }
示例#7
0
 void Awake()
 {
     DontDestroyOnLoad(transform.gameObject);
     Instance = this;
 }
 public void triggerWinnerScreen()
 {
     winnerScreen.SetActive(true);
     TotalScript.setLocked(false);
 }
示例#9
0
 public void Attack()
 {
     Physics2D.gravity = new Vector2(Physics2D.gravity.x * -1, Physics2D.gravity.y * -1);
     TotalScript.Invert();
 }