Example #1
0
    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);
        }
    }
Example #2
0
 public void Start()
 {
     fishM = FindObjectOfType <FishyManager>();
 }
Example #3
0
 void Awake()
 {
     Instance  = this;
     theStates = FishingStates.NOTFISHING;
 }