コード例 #1
0
    public void PickPen2()
    {
        penChoice = 2;
        LevelManager.instance.SpawnAnimalTypeWithLocation(animalToCreate, basicInteractions.spawnPen02);

        if (animalToCreate == Animal.AnimalType.Sheep)
        {
            LevelManager.instance.sheepToCreate--;
        }
        else if (animalToCreate == Animal.AnimalType.Alpaca)
        {
            LevelManager.instance.alpacaToCreate--;
        }

        pen02Info.AddAnimalToPen();
        PlayerManager.instance.playerSave.pen02Animals = pen02Info.GetCurrentAnimals();

        if (LevelManager.instance.sheepToCreate > 0 || LevelManager.instance.alpacaToCreate > 0)
        {
            this.gameObject.SetActive(true);
        }
        else
        {
            this.gameObject.SetActive(false);
        }
    }
コード例 #2
0
    bool AddAnimalToPen()
    {
        Pen pen = PlayerMove.GetPenStructure().GetComponent <Pen>();

        if (pen.HasRoomForAnimal())
        {
            pen.AddAnimalToPen(ObjectInHand);
            return(true);
        }
        return(false);
    }