void Awake() { NotificationController = NotificationObject.GetComponent <NotificationController>(); ObjectiveController = ObjectiveObject.GetComponent <ObjectiveController>(); ElectricCableController = ElectricCable.GetComponent <ElectricCableController>(); AirlockDoorController = AirlockOuterDoor.GetComponent <AirlockDoorController>(); VoiceLines = GetComponent <AudioSource>(); AirlockPressurisationController = AirlockTrigger.GetComponent <AirlockPressurisationController>(); FabricatorController = FabricatorTrigger.GetComponent <FabricatorController>(); PlayerStats = GetComponent <PlayerStats>(); BeaconLocationController = GetComponent <BeaconLocationController>(); RescueController = GetComponent <RescueController>(); }
void Awake() { OxygenBar = OxygenBarObject.GetComponent <Slider>(); OxygenBarText = OxygenBarObject.GetComponentInChildren(typeof(Text), true) as Text; HealthBar = HealthBarObject.GetComponent <Slider>(); HealthBarText = HealthBarObject.GetComponentInChildren(typeof(Text), true) as Text; StaminaBar = StaminaBarObject.GetComponent <Slider>(); PlayerController = GetComponent <RigidbodyFirstPersonController>(); PlayerActionController = GetComponent <PlayerActionController>(); PointsText = PointsTextObject.GetComponent <Text>(); BeaconController = GetComponent <BeaconLocationController>(); AmmoText = AmmoTextObject.GetComponent <Text>(); Notifications = NotificationObject.GetComponent <NotificationController>(); SoundEffect = GetComponent <AudioSource>(); // Set Oxygen to Max Oxygen = MaxOxygen; // Set Oxygen Slider Max Value OxygenBar.maxValue = MaxOxygen; // Set Health Slider Max Value HealthBar.maxValue = startingHealth; // Set Stamina Slider Max Value StaminaBar.maxValue = MaxStamina; // Set Points Text SetPointsText(Points); // Start OxygenTick Invoke("OxygenTick", 1f); // Initialize Player Health currentHealth = startingHealth; // Initialize Stamina PlayerStamina = MaxStamina; }