public void useItem() { if (this.itemName == "Potion") { Ouros = FindObjectOfType <Ouros>(); if (Ouros.HP != Ouros.maxHP) { if (Ouros.HP + 100 > Ouros.maxHP) { Ouros.HP = Ouros.maxHP; } else { Ouros.HP += 100; } Ouros.item.amount -= 1; } } if (this.itemName == "Ether") { Ouros = FindObjectOfType <Ouros>(); if (Ouros.magic.unLimit == false) { Ouros.GetComponent <Ouros>().magic.charge += 5; Ouros.item.amount -= 1; } } }
void Start() { doubleJumpAbilities = false; cameraPeekAbilities = false; doublieJumpSpeed = 80 * (jumpSpeed / 100); maxSpeed = speed; rid2d = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); gravityStore = rid2d.gravityScale; Ouros = GetComponent <Ouros>(); IngamePut = true; adInput = true; }
// Use this for initialization void Start() { Ouros = FindObjectOfType <Ouros>(); }