Пример #1
0
    protected override void OnStart()
    {
        var targetComponent = target ? target.GetComponent <HasQuantity>() : null;

        quantity = targetComponent != null?targetComponent.GetQuantity() : null;

        baseWidth = barImage.localScale.x;
        baseText  = text ? text.text : null;
    }
Пример #2
0
 public void OnUpdate(float dT, bool shouldShoot, Vector3 targetPos, Vector3 position, LimitedQuantity mana)
 {
     if (shotTimer <= 0.0f && shouldShoot)
     {
         int manaCost = (int)getShotData().manaCost;
         if (mana.Current >= manaCost)
         {
             mana.Add(-manaCost);
             shoot(targetPos, position);
         }
     }
     updateShotTimer(dT);
 }