void Start() { if( nextScene.Length == 0 ) { Debug.LogError("StartupManager: Failed to load next scene because there is none."); return; } pool = GetComponent<WeaponObjectPool>(); // keep his game object, regardless of which scene is loading DontDestroyOnLoad(transform.gameObject); // load real level/menu Application.LoadLevel( nextScene ); }
public void Initialize(Transform t, WeaponObjectPool wop) { if( standardMelee == null && standardRange == null ) { Debug.LogError("WeaponController: No standard weapons found!"); return; } pool = wop; currentRangeWeapon = standardRange; currentMeleeWeapon = standardMelee; currentWeapon = standardMelee; CreateStandardWeapons( t ); weaponAnchor = t; }