//单例初始化
 void Awake()
 {
     if (!Instance)
         Instance = this;
     else if (Instance != this)
         Destroy(gameObject);
 }
 //单例初始化
 void Awake()
 {
     if (!Instance)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemple #3
0
 void Awake()
 {
     _instance = this;
     GetPlayerModel();
     ShowModel();
     //player = GameObject.FindGameObjectWithTag("Player");
     closeButton.onClick.AddListener(CloseSitting);
     startButton.onClick.AddListener(ChangeScene);
     settingButton.onClick.AddListener(OpenSettings);
     shopButton.onClick.AddListener(OpenShop);
     exitButton.onClick.AddListener(ClickExitBtn);
     backButton.onClick.AddListener(CloseShop);
     yesButton.onClick.AddListener(BuySomething);
     noButton.onClick.AddListener(CloseShopEnter);
     //playerAnimator = player.GetComponent<Animator>();
     //playerAudio =player.GetComponent<AudioSource>();
     GetMoney();
     if (!PlayerPrefs.HasKey("PlayerSelectModel"))
     {
         PlayerPrefs.SetInt("PlayerSelectModel", 0);
     }
 }