public void setStage(stageStatus _stage) { DateTime endTime; actualStageStatus = _stage; if (PlayerPrefs.HasKey("stageDurationReduce")) { float reduce = PlayerPrefs.GetFloat("stageDurationReduce"); endTime = timeManager.currentTime().AddHours(_stage.stageDuration * (100 - reduce) / 100); PlayerPrefs.DeleteKey("stageDurationReduce"); } else { endTime = timeManager.currentTime().AddHours(_stage.stageDuration); } PlayerPrefs.SetInt("AnimationCount", (PlayerPrefs.GetInt("AnimationCount") + 1)); foreach (var aux in coffeTrees) { aux.GetComponent <CoffeAnimationManager>().setAnimator(PlayerPrefs.GetInt("AnimationCount")); } PlayerPrefs.SetString("stageEnd", endTime.ToString()); PlayerPrefs.SetString("stageStart", timeManager.currentTime().ToString()); managerEvent.setTimeEvent(); notificationReference.GetComponent <NotificationTest>().stageEnd(); }
void Start() { coffeTrees = GameObject.FindGameObjectsWithTag("coffeTree"); stageUI.SetActive(false); InvokeRepeating("testStage", 0.5f, 0.5f); InvokeRepeating("setVisualCurrentStage", 2f, 60f); if (!PlayerPrefs.HasKey("indexStageGroup")) { PlayerPrefs.SetInt("indexStageGroup", 0); indexGroupStage = 0; } else { indexGroupStage = PlayerPrefs.GetInt("indexStageGroup"); } if (!PlayerPrefs.HasKey("indexStage")) { PlayerPrefs.SetInt("indexStage", 0); indexStage = 0; StartCoroutine("StartNewCycle"); } else { indexStage = PlayerPrefs.GetInt("indexStage"); } setStageGroup(indexGroupStage); actualStageStatus = stageList[indexStage]; stageSetCorrect(); if (PlayerPrefs.HasKey("AnimationCount")) { foreach (var aux in coffeTrees) { aux.GetComponent <CoffeAnimationManager>().setAnimator(PlayerPrefs.GetInt("AnimationCount")); } } else { PlayerPrefs.SetInt("AnimationCount", -1); } }
public void SetMyStage(stageStatus aux) { myStageStatus = aux; }