Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        SM        = GetComponent <FSMStateManager>();
        Target    = GameObject.FindGameObjectWithTag("Player").GetComponent <FSMStateManager>();
        SM.Target = Target.gameObject;
        NA        = GetComponent <NavMeshAgent>();

        Dash         = GetComponent <Charge>();
        DashCooldown = Dash.GetCooldownTime();
        //Debug.Log("Cooldown Dash: " + DashCooldown);
    }
Exemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (IsPlayer)
     {
         if (PlayerCharge == null)
         {
             PlayerCharge = GameObject.FindGameObjectWithTag("Player").GetComponent <Charge>();
         }
         else
         {
             float floatText = Mathf.Round((PlayerCharge.GetCooldownTime() - PlayerCharge.GetCooldownTimer()) * 100) / 100;
             ChargeText.text = "" + floatText;
         }
     }
 }