private void Awake() { //load playerData or set default values PlayerDataController.Initialize(); PlayerDataController.Instance.LoadData(); GameData.Initialize(); SoundManager.Initialize(); }
private void Awake() { if (Instance == null) { Instance = this; } IsGameEnded = false; WinScreen.SetActive(false); LoseScreen.SetActive(false); //StartCoroutine(CameraShaking(0)); #if UNITY_EDITOR SoundManager.Initialize(); GameData.Initialize(); if (PlayerDataController.Instance == null) { PlayerDataController.Initialize(); } #endif }
// Start is called before the first frame update void Start() { PlayerDataController.Initialize(); Years = 0; LifeHandlerRef.Initialize(); OnStep = new UnityEvent(); GameUIRef.OnModeToggleClick.AddListener(ChangeGameMode); GameUIRef.OnStepButtonClick.AddListener(RequestNextStep); InputControllerRef.OnTap.AddListener(ProcessTap); InputControllerRef.OnSwipe.AddListener(ProcessSwipe); InputControllerRef.OnDrag.AddListener(ProcessDrag); NodeInfo.OnButtonsClick.AddListener(ProcessNodeInfoPanelButtonClick); NodeInfo.gameObject.SetActive(false); PowerBarRef.Initialize(_maxPower); OnStep.AddListener(NodeInfo.UpdateInfo); ControlPanelRef.OnSpawnButtonClick.AddListener(ProcessSpawnModeButtonClick); ControlPanelRef.OnRemoveButtonClick.AddListener(ProcessRemoveModeButtonClick); }