Пример #1
0
    IEnumerator ApplyPhysics(Rigidbody body)
    {
        stateManager.state = StateManager.States.TURN_ENDING;

        body.transform.localRotation = Quaternion.Euler(0, -90, 0);

        body.AddRelativeForce(arrow.forward * powerManager.power * physicsForce);

        yield return(new WaitForSeconds(2f));

        powerBarManager.ChangeScale(new Vector3(0, 11, 1));
        turnManager.ChangeTurn();
    }
Пример #2
0
 void PowerUpdate()
 {
     input = Input.GetAxis("Vertical");
     //se ainda puder carregar o powerbar
     if (power < maxPowerBar)
     {
         //power sera adicionado passo a passo, de acordo com o input
         power = Mathf.MoveTowards(power, maxPowerBar * input, Time.deltaTime * maxPowerBar);
     }
     //aumentar/diminuir o tamanho da UI de acordo com power
     if (power > 0.0f)
     {
         powerBarManager.ChangeScale(new Vector3(power, 11, 1));
     }
 }