Ejemplo n.º 1
0
	// Member Methods
	public void Start()
	{
		m_PowerStorage = gameObject.GetComponent<CPowerStorageBehaviour>();

		// Register for when the circuitry breaks/fixes
		m_Circuitry1.EventComponentBreak += HandleCircuitryStateChange;
		m_Circuitry1.EventComponentFix += HandleCircuitryStateChange;
		m_Circuitry2.EventComponentBreak += HandleCircuitryStateChange;
		m_Circuitry2.EventComponentFix += HandleCircuitryStateChange;

		// Get the DUI of the power generator
		m_DUIPowerCapacitor = m_DUIConsole.DUI.GetComponent<CDUIPowerCapacitorRoot>();
		m_DUIPowerCapacitor.RegisterPowerCapacitor(gameObject);

		// Debug: Set the charge to half its total capacity
		if(CNetwork.IsServer)
		{
			m_PowerStorage.BatteryCapacity = m_MaxPowerBatteryCapacity;
			m_PowerStorage.BatteryCharge = m_PowerStorage.BatteryCapacity / 2;
		}
	}
Ejemplo n.º 2
0
    // Member Methods
    public void Start()
    {
        m_PowerStorage = gameObject.GetComponent <CPowerStorageBehaviour>();

        // Register for when the circuitry breaks/fixes
        m_Circuitry1.EventComponentBreak += HandleCircuitryStateChange;
        m_Circuitry1.EventComponentFix   += HandleCircuitryStateChange;
        m_Circuitry2.EventComponentBreak += HandleCircuitryStateChange;
        m_Circuitry2.EventComponentFix   += HandleCircuitryStateChange;

        // Get the DUI of the power generator
        m_DUIPowerCapacitor = m_DUIConsole.DUI.GetComponent <CDUIPowerCapacitorRoot>();
        m_DUIPowerCapacitor.RegisterPowerCapacitor(gameObject);

        // Debug: Set the charge to half its total capacity
        if (CNetwork.IsServer)
        {
            m_PowerStorage.BatteryCapacity = m_MaxPowerBatteryCapacity;
            m_PowerStorage.BatteryCharge   = m_PowerStorage.BatteryCapacity / 2;
        }
    }