コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     Instance     = this;
     weaponType   = currentWeapons[selectedWeapon];
     weaponScript = weaponType.GetComponent <WeaponScript>();
     weaponScript.localWeaponText.SetActive(true);
 }
コード例 #2
0
 void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(gameObject);
         Combat = new Combat();
         instance = this;
     }
     else
     {
         if (instance != this)
         {
             Destroy(gameObject);
         }
     }
 }