Beispiel #1
0
    public void PrePool()
    {
        WeaponWrapper = GetComponent <ModuleWeaponWrapper>();
        if (WeaponWrapper == null)
        {
            WeaponWrapper = gameObject.AddComponent <ModuleWeaponWrapper>();
        }
        EnergyStore = GetComponent <ModuleEnergyStore>();
        //Energy = GetComponent<ModuleEnergy>();
        EnergyStore.m_Capacity = EnergyCapacity;

        // Backup fallback
        foreach (CustomGauge gauge in _gauges)
        {
            if (gauge.MinValue == gauge.MaxValue && gauge.MinValue == 0f)
            {
                gauge.MinValue = LowestPermittedEnergy;
                gauge.MaxValue = EnergyCost;
            }
            else
            {
                if (gauge.MaxValue == 0f)
                {
                    gauge.MaxValue = EnergyCost;
                }
                if (gauge.MinValue == gauge.MaxValue)
                {
                    gauge.MaxValue++;
                }
            }
        }
    }
Beispiel #2
0
    public void OnPool()
    {
        //WeaponWrapper = GetComponent<ModuleWeaponWrapper>();
        //if (WeaponWrapper == null) WeaponWrapper = gameObject.AddComponent<ModuleWeaponWrapper>();

        // Just in case...
        WeaponWrapper = GetComponent <ModuleWeaponWrapper>();
        EnergyStore   = GetComponent <ModuleEnergyStore>();
        Energy        = GetComponent <ModuleEnergy>();

        Energy.UpdateConsumeEvent.Subscribe(ConsumeFire);
        WeaponWrapper.CanFireEvent += CheckIfCanFire;
        WeaponWrapper.FireEvent    += OnFire;
        WeaponWrapper.LockFiring(this, true);
        block.DetachEvent.Subscribe(OnDetach);
    }
Beispiel #3
0
 public void PrePool()
 {
     _EnergyStore            = GetComponent <ModuleEnergyStore>();
     _Energy                 = GetComponent <ModuleEnergy>();
     _EnergyStore.m_Capacity = Capacity;
 }