private void OnGUI() { capsule = FindObjectOfType <CapsuleAirController>(); scroll = GUILayout.BeginScrollView(scroll); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); { PrintLabel("Current air"); ShowAirGUI(capsule.air); } GUILayout.EndVertical(); GUILayout.BeginVertical(); { PrintLabel("Target air"); ShowAirGUI(capsule.targetAir); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); PrintLabel("Tanks"); ShowAllTanks(); GUILayout.EndScrollView(); }
private void Awake() { if (!instance) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
void Start() { airController = GetComponentInParent <CapsuleAirController>(); tank = GetComponentInChildren <GasTank>(); powerSocket = GetComponent <PowerSocket>(); }
void Start() { airController = GetComponentInParent <CapsuleAirController>(); powerSocket = GetComponent <PowerSocket>(); }