コード例 #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);
        }
    }
コード例 #2
0
ファイル: WaterContact.cs プロジェクト: fippan/Fish
 public void Start()
 {
     fishM = FindObjectOfType <FishyManager>();
 }
コード例 #3
0
 void Awake()
 {
     Instance  = this;
     theStates = FishingStates.NOTFISHING;
 }