private void Awake()
    {
        _enemyPrefabs = new Dictionary <EnemyType, GameObject>
        {
            { EnemyType.Speedster, enemySpeedsterPrefab },
            { EnemyType.PlainJane, enemyPlainJanePrefab },
            { EnemyType.BigBoi, enemyBigBoiPrefab },
            { EnemyType.CrabLeft, enemyCrabLeftPrefab },
            { EnemyType.CrabRight, enemyCrabRightPrefab },
            { EnemyType.HugeAsteroid, hugeAsteroidPrefab },
            { EnemyType.MediumAsteroid, mediumAsteroidPrefab },
            { EnemyType.HomingCorvet, homingCorvettePrefab },
            { EnemyType.NovaSaucer, novaSaucerPrefab },
            { EnemyType.MediumShrapnelAsteroid, mediumShrapnelAsteroidPrefab },
            { EnemyType.Shockwave, shockwavePrefab },
            { EnemyType.BulletAsteroid, bulletAsteroidPrefab },
            { EnemyType.Canon, enemyCanonPrefab },
            { EnemyType.ResourceAsteroid, resourceAsteroidPrefab },
            { EnemyType.AsteroidTurret, asteroidTurretPrefab },
            { EnemyType.RadialTurret, radialTurretPrefab },
        };

        EnemyDestroyedOrRemovedEvent = new UnityGameObjectEvent();
        EnemyBlownUpEvent            = new UnityGameObjectEvent();
    }
Ejemplo n.º 2
0
 private void Start()
 {
     if (ProblemDestroyedOrRemovedEvent == null)
     {
         ProblemDestroyedOrRemovedEvent = new UnityGameObjectEvent();
     }
 }
Ejemplo n.º 3
0
    private void Awake()
    {
        _audioSource       = GetComponent <AudioSource>();
        _movementBehaviour = GetComponent <MovementBehaviour>();

        EnemyDestroyedOrRemovedEvent = new UnityGameObjectEvent();
        BlownUpEvent = new UnityGameObjectEvent();
    }
Ejemplo n.º 4
0
 private void Awake()
 {
     if (EnemyDestroyedOrRemovedEvent == null)
     {
         EnemyDestroyedOrRemovedEvent = new UnityGameObjectEvent();
     }
     if (BlownUpEvent == null)
     {
         BlownUpEvent = new UnityGameObjectEvent();
     }
 }
    private void Awake()
    {
        _rigidbody2D    = GetComponent <Rigidbody2D>();
        _audioSource    = GetComponent <AudioSource>();
        _spriteRenderer = GetComponent <SpriteRenderer>();

        if (exteriorManager == null)
        {
            exteriorManager = GameObject.FindObjectOfType <ExteriorManager>();
        }
        if (interiorManager == null)
        {
            interiorManager = GameObject.FindObjectOfType <InteriorManager>();
        }
        if (exteriorBoundsCamera == null)
        {
            GameObject exteriorBoundsObj = GameObject.Find("ExteriorCamera");
            if (exteriorBoundsObj != null)
            {
                exteriorBoundsCamera = exteriorBoundsObj.GetComponent <Camera>();
            }
        }

        shipHitEvent             = new UnityGameObjectEvent();
        exteriorShipUpdatedEvent = new ExteriorShipEvent();
        exteriorShipMoveEvent    = new ExteriorShipEvent();

        //currentHitPoints = maxHitPoints; // disabled, so can set starting health in editor.

        // calc bounds

        if (exteriorBoundsCamera != null)
        {
            xMin = exteriorBoundsCamera.ViewportToWorldPoint(new Vector3(0, 0, 0)).x + boundsPadding;
            xMax = exteriorBoundsCamera.ViewportToWorldPoint(new Vector3(1, 0, 0)).x - boundsPadding;

            yMin = exteriorBoundsCamera.ViewportToWorldPoint(new Vector3(0, 0, 0)).y + boundsPadding;
            yMax = exteriorBoundsCamera.ViewportToWorldPoint(new Vector3(0, 1, 0)).y - boundsPadding;
        }
    }
Ejemplo n.º 6
0
 public EventManager()
 {
     onCoinPickUp = new UnityGameObjectEvent();
     onJump       = new UnityEvent();
 }