Example #1
0
        /// <summary>
        /// Initializes
        /// </summary>
        /// <param name="referenceManager"> The reference manager </param>
        public void Initialize(ReferenceManager referenceManager)
        {
            if (!IsInitialized)
            {
                reference = referenceManager;

                if (bossPrefab != null)
                {
                    IsInitialized = true;
                    ObjectPoolManager opm = reference.objectPoolManager;

                    bossObject = opm.Spawn(gameObject, opm.GetTypeIdentifier(bossPrefab),
                                           bossSpawn.position, bossSpawn.rotation, transform);

                    bossScript = bossObject.GetComponent <NewBoss>();
                    TransitionState(BossStates.Intro);
                }
                else
                {
                    Debug.LogError(GetType().Name + " - bossPrefab is not set.");
                }
            }
        }
Example #2
0
 /// <summary>
 /// Initializes the Reference Manager and Object Pool Manager references
 /// </summary>
 private void Awake()
 {
     reference         = GameObject.Find("Reference Manager").GetComponent <ReferenceManager>();
     waveManager       = reference.waveManager;
     objectPoolManager = reference.objectPoolManager;
 }