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; } }
public void Update() { if (isNormalRotation != TotalScript.GetGravity()) { isNormalRotation = TotalScript.GetGravity(); TotalScript.GravityFlip(gameObject); } }
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"; } }
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); }
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); } } } }
public void Start() { isNormalRotation = TotalScript.GetGravity(); }
void Awake() { DontDestroyOnLoad(transform.gameObject); Instance = this; }
public void triggerWinnerScreen() { winnerScreen.SetActive(true); TotalScript.setLocked(false); }
public void Attack() { Physics2D.gravity = new Vector2(Physics2D.gravity.x * -1, Physics2D.gravity.y * -1); TotalScript.Invert(); }