Beispiel #1
0
    void spawnWFS(int num, Vector3 vec, int source)
    {
        wfs[num] = Instantiate(WhiteFS, vec, Quaternion.identity) as GameObject;
        WhiteFSScript wfsscript = wfs[num].GetComponent <WhiteFSScript>();

        wfsscript.source = source;
        if (num == atter)
        {
            wfsscript.attacker = true;
        }
        wfsscript.spawner  = this;
        wfsscript.num      = num;
        cams.enemiesAlive += 1;
        enemiesAlive      += 1;
    }
Beispiel #2
0
    void WFSdied(int num)
    {
        Destroy(wfs[num]);
        cams.enemiesAlive -= 1;
        enemiesAlive      -= 1;
        cams.points       += 1;
        wfs[num]           = null;
        bool neednew = false;

        if (atter == num)
        {
            neednew = true;
        }
        if (neednew && enemiesAlive > 0)
        {
            bool going = true;
            bool gone  = false;
            while (going)
            {
                num++;
                if (numEn >= num)
                {
                    if (wfs[num] != null)
                    {
                        WhiteFSScript wsscript = wfs[num].GetComponent <WhiteFSScript>();
                        wsscript.attacker = true;
                        atter             = num;
                        going             = false;
                    }
                }
                else
                {
                    gone = true;
                    num  = 0;
                }
            }
        }
        else if (neednew && stage != 4)
        {
            atter = stage + 1;
        }
        if (enemiesAlive == 0 && done1 == true && done2 == false)
        {
            go2   = true;
            atter = 1;
        }
    }