Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using UnityEngine;
- namespace SolarActionGroup
- {
- [KSPAddon(KSPAddon.Startup.Flight , false)]
- public class SolarActionGroup : MonoBehaviour
- {
- public void Update(){
- if (Input.GetKeyDown(KeyCode.P) && FlightGlobals.ActiveVessel.IsControllable){
- foreach (Part shipPart in FlightGlobals.ActiveVessel.parts){
- if(shipPart.gameObject.GetComponent<ModuleDeployableSolarPanel>() != null){
- ModuleDeployableSolarPanel panel = shipPart.gameObject.GetComponent<ModuleDeployableSolarPanel>();
- if (panel.status == "Retracted" && panel.sunTracking) {panel.Extend();}
- else if (panel.sunTracking && panel.retractable){panel.Retract();}
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement