void Awake() { if (instance == null) { instance = this; //Sets this to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); //PlayerPrefs.SetInt("Fishies", 0); //PlayerPrefs.SetInt("SecondsRemaining", 60); fishies = PlayerPrefs.GetInt("Fishies"); secondsRemaining = PlayerPrefs.GetInt("SecondsRemaining"); if (secondsRemaining == 0) { secondsRemaining = 60; } SceneManager.sceneLoaded += OnSceneLoaded; littleClock = transform.GetChild(0).gameObject; littleClock.SetActive(false); } else { Destroy(gameObject); } }
public void Start() { fishM = FindObjectOfType <FishyManager>(); }
void Awake() { Instance = this; theStates = FishingStates.NOTFISHING; }