public void ProcessEnymObjectsInSimulation()
    {
        for (int i = enemyObjects.Count - 1; i >= 0; i--)
        {
            if (enemyObjects[i].toBeRemovedFromSimulation == true)
            {
                enemyObjects[i].toBeRemovedFromSimulation = false;
                PoolModule.BackObjectToPool(enemyObjects[i].GetMainObject());
                enemyObjects.RemoveAt(i);
            }
            else
            {
                enemyObjects[i].PreformBehaviour();
                if (enemyObjects[i].isAvaiableForInteraction)
                {
                    for (int j = 0; j < ListOfObjectsThatInteractiWithEnemiesAtThisFrame.Count; j++)
                    {
                        float distance = Vector2.Distance(enemyObjects[i].GetPosition(), ListOfObjectsThatInteractiWithEnemiesAtThisFrame[j].GetTransform().position);

                        if (enemyObjects[i].CanBehHitWithImploder && ListOfObjectsThatInteractiWithEnemiesAtThisFrame[j].isReadyToDestroyImplodingMinionsOnEnemy)
                        {
                            if (distance < enemyObjects[i].objectRadius)
                            {
                                ListOfObjectsThatInteractiWithEnemiesAtThisFrame[j].ToggleImplodingEnemyAttack(enemyObjects[i]);
                            }
                        }
                        if (distance < ListOfObjectsThatInteractiWithEnemiesAtThisFrame[j].GetInteractionDistance())
                        {
                            enemyObjects[i].LaunchInteraction(ListOfObjectsThatInteractiWithEnemiesAtThisFrame[j].GetReferenceToMainObject());
                        }
                    }
                }
            }
        }
    }
예제 #2
0
    public PoolableObject SpawnPollableObject(Transform _prefab, Vector2 _spawnPosition)
    {
        Vector2        spawnPosition     = _spawnPosition;
        PoolableObject newPoolableObject = PoolModule.Reuse(_prefab);

        newPoolableObject.transform.position = spawnPosition;
        return(newPoolableObject);
    }
예제 #3
0
    public PoolableObject SpawnPollableObject(Transform _prefab, SpawnPointWheel _spawnPointWheel)
    {
        Vector2        spawnPosition     = _spawnPointWheel.GetRandomSpawnPosition();
        PoolableObject newPoolableObject = PoolModule.Reuse(_prefab);

        newPoolableObject.transform.position = spawnPosition;
        return(newPoolableObject);
    }
예제 #4
0
    //PoolModule poolManager = new PoolModule();

    void Start()
    {
        PoolModule poolManager = new PoolModule();
        var        pool        = poolManager.PutElement(prefObj, 10);

        var el1 = pool.GetElement(transform);
        var el2 = pool.GetElement(transform);

        el2.Return();
    }
    public void CreateInstanceModules()
    {
        cameraController = ModuleCreator.Create <CameraController>("camController");
        PoolModule.CreatePool(PrefabCollection.Meteor, 1000, "Meteor Pool");
        PoolModule.CreatePool(PrefabCollection.Bomber, 30, "Bomber Pool");

        launchedExploders  = new List <Exploder>();
        launchedImploders  = new List <Imploder>();
        launchedDefenders  = new List <Defender>();
        GameplayController = new GameplayController();
        cameraController.SetupTarget();
    }
예제 #6
0
 public void LaunchModules()
 {
     InstantiateModule     = MainController.Instance.ModuleCreator.Create <InstantiateModule>   ("InstantiateModule");
     PoolModule            = MainController.Instance.ModuleCreator.Create <PoolModule>          ("PoolModule");
     PrefabCollection      = MainController.Instance.ModuleCreator.Create <PrefabCollection>    ("PrefabCollection");
     ObjectSpawner         = MainController.Instance.ModuleCreator.Create <ObjectSpawner>       ("ObjectSpawner");
     LevelCollection       = new LevelCollection();
     LevelLoader           = new LevelLoader();
     TimeingManager        = new TimeingManager();
     InputModuleUIMode     = new InputModuleUIMode();
     InputModulePlayMode   = new InputModulePlayMode();
     StageCreator          = new StageCreator();
     CoreParametersCreator = new CoreParametersCreator();
     PointSystemCreator    = new PointSystemCreator();
 }