コード例 #1
0
    private void Awake()
    {
        for (int i = 0; i < shop.GetComponent <Shop>().slotItem.Length; i++)
        {
            int rng = Random.Range(0, allItemInGame.Count);
            objectToSell.Add(allItemInGame[rng]);
        }

        instance = this;
    }
コード例 #2
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }