internal void Initialize(IAssetDispenser assetDispenser)
    {
        this.assetDispenser = assetDispenser;
        if (inputReader == null)
        {
            inputReader = new InputReader(sessionCam.ScreenToWorldPoint);
        }

        if (boundsChecker == null)
        {
            boundsChecker = new ScreenBounds(sessionCam.ScreenToWorldPoint);
        }

        if (!sessionSpaceTransfrom)
        {
            sessionSpaceTransfrom = GetComponent <Transform>();
        }

        if (!station)
        {
            var stationPrefab = assetDispenser.GetSpaceStationPrefab();
            station = GameObject.Instantiate(stationPrefab, Vector3.zero,
                                             Quaternion.identity, sessionSpaceTransfrom);
            station.Killed += OnStationKilled;
            station.Initialize(assetDispenser, inputReader, boundsChecker, sessionEvents);
        }

        if (enemySpawner == null)
        {
            enemySpawner = new EnemySpawner(assetDispenser, boundsChecker, sessionEvents);
        }
    }
 internal void Initialize(IAssetDispenser assetDispenser, ICommandSource commandSource,
                          IScreenBoundsSchecker bounds, ISessionEventsListener eventListener)
 {
     this.commandSource = commandSource;
     this.eventListener = eventListener;
     gun.Initialize(assetDispenser, bounds, eventListener);
     this.visualsRequest.RequestLoad(assetDispenser);
 }
Esempio n. 3
0
 public void RequestLoad(IAssetDispenser assetDispenser)
 {
     if (Started)
     {
         return;
     }
     PrepareForLoadingImitation();
     assetDispenser.LoadAsync(assetsToLoad, OnAssetOrComponentLoaded);
     Started = true;
 }
    public void Initialize(IAssetDispenser assetDispenser, IScreenBoundsSchecker bounds,
                           ISessionEventsListener eventListener)
    {
        launchPoint = GetComponent <Transform>();

        firingQueue = new Queue <InputCommand>(Settings.FiringQueueLimit);

        this.assetDispenser = assetDispenser;
        boundsChecker       = bounds;
        this.eventListener  = eventListener;
    }
Esempio n. 5
0
    public EnemySpawner(IAssetDispenser assetDispenser, ScreenBounds bounds,
                        ISessionEventsListener eventListener)
    {
        this.assetDispenser = assetDispenser;
        this.boundsChecker  = bounds;
        this.eventListener  = eventListener;

        foreach (var preset in Settings.SpawnSettings)
        {
            spawned[preset.GroupId]       = new HashSet <Enemy>();
            spawnCapCount[preset.GroupId] = preset.StartCopiesCount;
        }
    }