예제 #1
0
    //  ------------------------------------- Add Space Marine

    public void AddMarine(int l)
    {
        spaceMarine a = new spaceMarine(l);

        marines.Add(a);
        numActiveMarines++;
        numSpaceMarines++;
    }
예제 #2
0
    // -------------------------------------------- Transfers space marine from this ship to target ship

    private void TransferMarine(spaceMarine m, int i, p_ship target)
    {
        print("In Transfer Marine");
        target.AddEnemyMarine(m);
        target.IncEnemyMarine();

        marines.RemoveAt(i);

        numSpaceMarines--;
    }
예제 #3
0
    // ------------------------------------- Ask the player how many marines they want to use in the assault

    //public IEnumerator GetNumAssaultMarines()
    //{
    //    // To do: make a function to create a UI to ask the user how many marines that they want to use
    //    int num =3;
    //    GC.GetComponent<SpaceMarinePopUp>().PopUp();

    //    while (!GC.GetComponent<SpaceMarinePopUp>().GetClicked())
    //    {
    //        yield return new WaitForSeconds(1f);
    //    }

    //    num = int.Parse(GC.GetComponent<SpaceMarinePopUp>().GetText());

    //    numMarinesUsed = num;
    //}


    // -------------------------------------------- Get the array of space marines being used in attack and return them

    private spaceMarine[] GetSpaceMarines(int num)
    {
        spaceMarine[] a = new spaceMarine[num];

        for (int i = 0; i < num; i++)
        {
            if (marines[i] != null)
            {
                a[i] = marines[i];
            }
        }

        return(a);
    }
예제 #4
0
    // --------------------------------------------- Adds marine to enemy ship

    public void AddEnemyMarine(spaceMarine m)
    {
        enemyMarines.Add(m);
    }