Пример #1
0
    /// <summary>
    /// Spawns the team AI entities from the spawn managers.
    /// </summary>
    private void SpawnEnemyEntities()
    {
        // Test spawn
        GameObject spawnedDroid = Instantiate(gameManager.enemySettings.droidSentryPrefab, transform.position, Quaternion.identity);

        IAssignSceneActorTracker assignTracker = spawnedDroid.GetComponent <IAssignSceneActorTracker>();

        assignTracker.SetSceneActorTracker(actorTracker);
        actorTracker.RegisterEnemyEntity(spawnedDroid);

        IEnemyController enemyController = spawnedDroid.GetComponent <IEnemyController>();

        enemyController.InitialiseController();
    }
        private void InitialiseStats()
        {
            IActorTracker            actorTracker  = GameManager.Instance.sceneController.ActorTracker;
            IAssignSceneActorTracker assignTracker = this.GetComponent <IAssignSceneActorTracker>();

            assignTracker.SetSceneActorTracker(actorTracker);

            EnemyInfo enemyInfo = GameManager.Instance.enemySettings.enemyList.Where(x => x.instanceID == referenceID).First().ConvertToEnemyInfo();

            shipData = enemyInfo.GetShipData();

            EnemyStatHandler statHandler = this.GetComponent <EnemyStatHandler>();

            statHandler.InitialiseStats(enemyInfo);

            RegisterToTracker();
        }