// Member Properties // Member Methods public void Start() { m_PowerGenerator = gameObject.GetComponent <CPowerGenerationBehaviour>(); // Register for when the calibrator breaks/fixes m_CalibrationComponent.EventHealthChange += HandleCalibrationHealthChange; // Register for when the circuitry breaks/fixes m_CircuitryComponent.EventComponentBreak += HandleCircuitryBreaking; m_CircuitryComponent.EventComponentFix += HandleCircuitryFixing; // Get the DUI of the power generator m_DUIPowerGeneration = m_DUIConsole.DUI.GetComponent <CDUIPowerGeneratorRoot>(); m_DUIPowerGeneration.RegisterPowerGenerator(gameObject); if (CNetwork.IsServer) { // Set the generation rate m_PowerGenerator.PowerGenerationRate = m_MaxPowerGenerationRate; m_PowerGenerator.PowerGenerationRatePotential = m_MaxPowerGenerationRate; } // Set the cubemap for the children foreach (Renderer r in GetComponentsInChildren <Renderer>()) { r.material.SetTexture("_Cube", transform.parent.GetComponent <CModulePortInterface>().CubeMapSnapshot); } }
// Member Properties // Member Methods public void Start() { m_PowerGenerator = gameObject.GetComponent<CPowerGenerationBehaviour>(); // Register for when the calibrator breaks/fixes m_CalibrationComponent.EventHealthChange += HandleCalibrationHealthChange; // Register for when the circuitry breaks/fixes m_CircuitryComponent.EventComponentBreak += HandleCircuitryBreaking; m_CircuitryComponent.EventComponentFix += HandleCircuitryFixing; // Get the DUI of the power generator m_DUIPowerGeneration = m_DUIConsole.DUI.GetComponent<CDUIPowerGeneratorRoot>(); m_DUIPowerGeneration.RegisterPowerGenerator(gameObject); if(CNetwork.IsServer) { // Set the generation rate m_PowerGenerator.PowerGenerationRate = m_MaxPowerGenerationRate; m_PowerGenerator.PowerGenerationRatePotential = m_MaxPowerGenerationRate; } // Set the cubemap for the children foreach(Renderer r in GetComponentsInChildren<Renderer>()) { r.material.SetTexture("_Cube", transform.parent.GetComponent<CModulePortInterface>().CubeMapSnapshot); } }