private void Start() { if (Game_GlobalInfo.singleton != null) { _GlobalInfo = Game_GlobalInfo.singleton; } else { Debug.LogError("Game_GlobalInfo didnt get to it"); } if (AllCharacterCanvas.Count == 0) { } else { _GlobalInfo.AvatarsList = new List <bool>(new bool[AllCharacterCanvas.Count]); _GlobalInfo.AvatarsList[0] = true; CurrentAngle = 90; } Button_Back.onClick.AddListener(GameManager_MainMenu.OnLeavingAvatarPage); Button_Next.onClick.AddListener(NextAvatar); //Button_Next.onClick.AddListener for (int i = 0; i < Button_AvatarSelected.Count; i++) { Button_AvatarSelected[i].onClick.AddListener(delegate { OnSelectingAvatar(EventSystem.current.currentSelectedGameObject); }); } }
private void Awake() { if (AppStarted == false) { AppStarted = true; if (PlayerPrefs.HasKey("PlayerData_Lives") && PlayerPrefs.HasKey("PlayerData_ManaPoints")) { #region UNUSED //Debug.Log("Key found!"); //TotalTimeInGame = PlayerPrefs.GetFloat("TimeOutTiming"); //Seconds = TotalTimeInGame; //Debug.Log("Current time = " + Seconds); //currentDate = System.DateTime.Now; //long temp = Convert.ToInt64(PlayerPrefs.GetString("TimeOutTiming")); //DateTime oldDate = DateTime.FromBinary(temp); //print("old Date: " + oldDate); //print("new Date: " + currentDate); //TimeSpan difference = currentDate.Subtract(oldDate); //print("Difference - Minutes:" + difference.Minutes + " Seconds:" + difference.Seconds + " Total:" + difference.TotalSeconds); //PlayerPrefs.DeleteKey("TimeOutTiming"); #endregion Player_Lives = PlayerPrefs.GetInt("PlayerData_Lives"); PAM.Ability1_Quantity_Start = PlayerPrefs.GetInt("PlayerData_ManaPoints"); Debug.Log("Loading Lives = " + Player_Lives + " | " + "Mana = " + PAM.Ability1_Quantity_Start); } else { Debug.Log("New player no Live found!"); Player_Lives = 100; } ThisIsMain = true; singleton = this; DontDestroyOnLoad(gameObject); //Debug.Log(Game_GlobalInfo.singleton + " is main = " + ThisIsMain, gameObject); OnNextLevelCheck(); } else { } }