private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
private void Awake() { a_audio_source = GetComponent <AudioSource>(); if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
// Use this for initialization void Awake() { if (_instance != null) { Debug.LogError("Creating multiple GameManagers!"); } _instance = this; Inventory = new Script_Inventory(); CharacterManager = new Script_CharacterManager(); UIManager = new Script_UIManager(); CombatTextManager = new Script_CombatTextManager(); Inventory.AddItem(new Script_HealthPotion(), 15); //Give player sword to start with var sword = new Script_Sword(); Inventory.AddItem(sword); CharacterManager.GetCharacters()[0].EquipItem(sword); }