Пример #1
0
    private void ConsumePower()
    {
        Turret turret;

        if (component.GetTurret(out turret))
        {
            turret.ConsumePower(powerConsumption * Time.deltaTime);
        }
    }
Пример #2
0
    private void Fitted(TurretComponent component, Armament arment)
    {
        Turret turret;

        if (component.GetTurret(out turret))
        {
            turret.RegisterBatery(this);
        }
    }
Пример #3
0
 internal virtual bool GetTurret(out Turret turret)
 {
     if (parentComponent == null)
     {
         turret = null;
         return(false);
     }
     return(parentComponent.GetTurret(out turret));
 }
Пример #4
0
    // Update is called once per frame
    void Update()
    {
        Turret turret;

        if (component.GetTurret(out turret))
        {
            turret.ProducePower(production * Time.deltaTime);
        }
    }
Пример #5
0
    void Start()
    {
        component = GetComponent <TurretComponent>();
        Turret turret;

        if (component.GetTurret(out turret))
        {
            turret.RegisterBatery(this);
        }
        else
        {
            component.onFittedEvent += Fitted;
        }

        UpdateGlow();
    }