Ejemplo n.º 1
0
    void Start()
    {
        points    = new Vector3[3];
        points[0] = pos;

        float xMin = Utils.camBounds.min.x + Main.S.enemySpawnPadding;
        float xMax = Utils.camBounds.max.x - Main.S.enemySpawnPadding;

        Vector3 v;

        v         = Vector3.zero;
        v.x       = Random.Range(xMin, xMax);
        v.y       = Random.Range(Utils.camBounds.min.y, 0);
        points[1] = v;

        v         = Vector3.zero;
        v.y       = pos.y;
        v.x       = Random.Range(xMin, xMax);
        points[2] = v;

        birthTime = Time.time;

        if (weaponActive)
        {
            weapon.SetType(WeaponType.spread);
            Invoke("Fire", 3f);
        }
        for (int i = 0; i < materials.Length; i++)
        {
            materials[i].color = EnemySettings.getColor(3);
            originalColors[i]  = EnemySettings.getColor(3);
        }
        ID = 3;
    }
Ejemplo n.º 2
0
    void Start()
    {
        points = new Vector3[2];

        Vector3 cbMin = Utils.camBounds.min;
        Vector3 cbMax = Utils.camBounds.max;

        Vector3 v = Vector3.zero;

        v.x       = cbMin.x - Main.S.enemySpawnPadding;
        v.y       = Random.Range(cbMin.y, cbMax.y);
        points[0] = v;

        v         = Vector3.zero;
        v.x       = cbMax.x + Main.S.enemySpawnPadding;
        v.y       = Random.Range(cbMin.y, cbMax.y);
        points[1] = v;

        if (Random.value < 0.5f)
        {
            points[0].x *= -1;
            points[1].x *= -1;
        }

        birthTime = Time.time;
        for (int i = 0; i < materials.Length; i++)
        {
            materials[i].color = EnemySettings.getColor(2);
            originalColors[i]  = EnemySettings.getColor(2);
        }
        ID = 2;
    }
Ejemplo n.º 3
0
 void Start()
 {
     for (int i = 0; i < materials.Length; i++)
     {
         materials[i].color = EnemySettings.getColor(0);
         originalColors[i]  = EnemySettings.getColor(0);
     }
     ID = 0;
 }
Ejemplo n.º 4
0
 void Start()
 {
     x0        = pos.x;
     birthTime = Time.time;
     for (int i = 0; i < materials.Length; i++)
     {
         materials[i].color = EnemySettings.getColor(1);
         originalColors[i]  = EnemySettings.getColor(1);
     }
     ID = 1;
 }
Ejemplo n.º 5
0
    void Start()
    {
        points    = new Vector3[2];
        points[0] = pos;
        points[1] = pos;
        InitMovement();
        Transform t;

        foreach (Part prt in parts)
        {
            t = transform.Find(prt.name);
            if (t != null)
            {
                prt.go  = t.gameObject;
                prt.mat = prt.go.GetComponent <Renderer>().material;
            }
        }
        for (int i = 0; i < materials.Length; i++)
        {
            materials[i].color = EnemySettings.getColor(4);
            originalColors[i]  = EnemySettings.getColor(4);
        }
        ID = 4;
    }