public void OnAnimalClick(SabanaAnimal animal)
    {
        // Walk to that point
        isMoving       = true;
        targetPosition = animal.CheetahPlace.transform.position;

        if (currentProp == null)
        {
            Handheld.Vibrate();
            return;
        }

        if (animal.animalType == Animal.Lion)
        {
            Flowers.SetActive(false);
            animal.SendMessage("OnReceivePresent", currentProp);
            currentProp = null;
            return;
        }

        if (animal.desiredGift == currentProp.prop)
        {
            animal.SendMessage("OnReceivePresent", currentProp);
            currentProp = null;
            return;
        }

        // Else: error
        Handheld.Vibrate();
    }
 public void OnResetPosition()
 {
     // Init all parameters
     transform.position = position;
     currentProp        = null;
     flowerCount        = 0;
     Flowers.SetActive(false);
 }
    public void OnFlowerClick(SabanaFlower flower)
    {
        // Walk to that point
        isMoving       = true;
        targetPosition = flower.transform.position;

        flowerCount++;
        if (flowerCount == 3)
        {
            Flowers.SetActive(true);
            currentProp = Flowers.GetComponent <SabanaProp>();
        }
    }
Exemplo n.º 4
0
    public void OnReceivePresent(SabanaProp prop)
    {
        isHappy = true;

        if (animalType == Animal.Lion && PinkLionMaterial != null)
        {
            // Change material
            gameObject.GetComponent <Renderer>().material = PinkLionMaterial;
            return;
        }

        prop.transform.position = Head.transform.position;
        if (prop.GetComponent <BoxCollider>() != null)
        {
            prop.GetComponent <BoxCollider>().enabled = false;
        }
    }
    public void OnPropClick(SabanaProp prop)
    {
        // Walk to that point
        isMoving       = true;
        targetPosition = prop.CheetahPlace.transform.position;

        if (currentProp != null)
        {
            // Player is already carrying something
            Handheld.Vibrate();
            return;
        }
        currentProp = prop;
        currentProp.transform.position = Head.transform.position;

        if (currentProp.prop == Prop.Kite)
        {
            GameObject.FindGameObjectWithTag("Map").SendMessage("BaseVictory");
        }
    }