Beispiel #1
0
    public void OnInteraction(Player player)
    {
        string type           = typeof(Plantimal).Name;
        var    selectedObject = player.selectedObject;

        if (player.selectedObject != null && player.selectedObject.isType(type))
        {
            Plantimal plantimal = (Plantimal)selectedObject;
            if (plantimal.isGrown)
            {
                Debug.Log("DeliveryPoint: This is a plantimal, let it here");
                bool res = RequestManager.Instance.validateRequest((Plantimal)selectedObject);
                if (!res)
                {
                    return;
                }
                player.setSelectedObject(null);
            }
            else
            {
                Debug.Log("DeliveryPoint: This plantimal is too small");
            }
        }
        else
        {
            Debug.Log("You give the plantimals here");
        }
    }
Beispiel #2
0
    private void harvest(Player player)
    {
        var       plantanimal = PlantimalFactory.Instance.instanciatePlantimal(plant.getAnimal(), biome);
        Plantimal plantimal   = plantanimal.GetComponent <Plantimal>();

        Debug.Log("NAME2: " + plantimal.getName());
        plantimal.OnInteraction(player);
        Debug.Log("NAME3: " + plantimal.getName());

        resetPot();
    }