Exemple #1
0
    public void SwapPlant(int index)
    {
        //show the 3 active plants in collection to swap with
        PlantManager plantManager = GetComponent <PlantManager>();

        popUpCanvas.GetComponent <PopUp>().PopUpSelectPlant(plantManager.GetActivePlantIndexes());
        selectingPlant = index;
    }
    public void GetPlantIndexesTest1()
    {
        string     name      = "daffy's plant";
        GameObject newPlant  = pmanager.MakePlant(name, "Jade");
        GameObject newPlant2 = pmanager.MakePlant(name + "(2)", "Jade");
        GameObject newPlant3 = pmanager.MakePlant(name + "(3)", "Aloe");
        GameObject newPlant4 = pmanager.MakePlant(name + "(4)", "Aloe");


        pmanager.SetPlantStatus(newPlant3, true);
        pmanager.SetPlantStatus(newPlant2, true);
        pmanager.SetPlantStatus(newPlant4, true);

        int[] arr = pmanager.GetActivePlantIndexes();

        Assert.IsTrue((arr[0] == 2 && arr[1] == 1 && arr[2] == 3), "3rd, 2nd and 4th plant were activated. They should come up in the that order");
    }