Beispiel #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("ContactZone") && canPickUp)
     {
         toolsManager.canDrop = false;
         toolsManager.ActivateActionInfo("Prendre " + item.name, 1, null);
         isInContact = true;
     }
 }
Beispiel #2
0
    private void Update()
    {
        if (Input.GetButtonDown("Action") && isInContact && !hasAnObject && !toolsManager.usingATool)
        {
            toolsManager.UseTool();

            // Animation
            toolsManager.GetComponent <Animator>().SetBool("pickUp", true);

            StartCoroutine("ItemInPipe");

            Inventory.instance.Remove(Inventory.instance.usedItem);
            if (Inventory.instance.usedItem == null)
            {
                toolsManager.CarryItem(false);
            }
            toolsManager.ActivateActionInfo("Poser", requiredUsingTools, "l'item");
        }
    }
Beispiel #3
0
 // change dialogue possibility to true if Oksusu is in the dialogue zone and run automatic dialogues
 void OnTriggerEnter(Collider colliderInfo)
 {
     if (colliderInfo.CompareTag("DialogueInput"))
     {
         isDialoguePossible = true;
         if (automaticDialogue)
         {
             ActiveDialogue();
             automaticDialogue = false;
         }
         else
         {
             toolManager.canDrop = false;
             toolManager.ActivateActionInfo(actionName, 1, null);
         }
     }
 }
Beispiel #4
0
    private void Update()
    {
        if (isFacingWater)
        {
            toolManager.canDrop = false;
            toolManager.ActivateActionInfo(actionName, 1, requiredToolName);
            if (Inventory.instance.isUsingTool(requiredToolName))
            {
                if (Input.GetButtonUp("Action") && !toolManager.usingATool)
                {
                    GetComponentInParent <PlayerMovement>().animator.SetBool("pickUp", true);
                    toolManager.StartCoroutine("UseTool");

                    toolManager.CarryItem(true, filledRecipient);

                    Inventory.instance.RemoveByName(requiredToolName);
                    Inventory.instance.Add(filledRecipient);
                    Inventory.instance.ChangeActiveTool(filledRecipient);

                    toolManager.DeactivateActionInfo();
                }
            }
        }
    }
    private void Update()
    {
        if (isInContact)
        {
            toolsManager.ActivateActionInfo(actionName, 1, requiredToolName, null);
            if (Inventory.instance.isUsingTool(requiredToolName))
            {
                if (Input.GetButtonUp("Action") && !toolsManager.usingATool)
                {
                    toolsManager.StartCoroutine("UseTool");

                    Inventory.instance.RemoveByName(requiredToolName);
                    Inventory.instance.Add(emptyRecipient);
                    Inventory.instance.ChangeActiveTool(emptyRecipient);

                    ChangeAnimation();
                    player.transform.LookAt(new Vector3(transform.position.x, player.transform.position.y, transform.position.z));

                    toolsManager.CarryItem(true, emptyRecipient);
                    toolsManager.DeactivateActionInfo();
                }
            }
        }
    }
    private void Update()
    {
        if (isInContact && Input.GetButtonDown("Action") && !toolsManager.usingATool)
        {
            toolsManager.UseTool();

            // Animation
            toolsManager.GetComponent <Animator>().SetBool("pickUp", true);

            if (nestIsEmpty)
            {
                // Put Egg in center
                //egg = Instantiate(Inventory.instance.usedItem.prefab, eggPosition.position, eggPosition.rotation, eggPosition);
                egg = Instantiate(Inventory.instance.usedItem.prefab, eggPosition);
                egg.GetComponent <Rigidbody>().isKinematic = true;
                egg.GetComponent <ItemPickup>().canPickUp  = false;
                egg.transform.position = eggPosition.position;

                Inventory.instance.Remove(Inventory.instance.usedItem);
                if (Inventory.instance.usedItem == null)
                {
                    toolsManager.CarryItem(false);
                }

                // Change Symbol aspect according to egg color
                mySymbol.myEgg = egg.GetComponent <ItemPickup>().item.name;
                mySymbol.changeColor(egg.GetComponent <ItemPickup>().item.name);
                if (mySymbol.CheckWin())
                {
                    GetComponent <CinematicTrigger>().Play();
                    ChangeAnimation();
                    win = true;
                }
                nestIsEmpty = false;
                toolsManager.ActivateActionInfo("Prendre", null, "Oeuf");
            }
            else
            {
                egg.GetComponent <ItemPickup>().canPickUp  = true;
                egg.GetComponent <Rigidbody>().isKinematic = false;
                Destroy(eggPosition.GetChild(0).gameObject);

                Inventory.instance.Add(egg.GetComponent <ItemPickup>().item);

                // Change Symbol aspect according to egg color
                mySymbol.myEgg = null;
                mySymbol.setDefaultColor();

                // reverse animation only if the door was open before
                if (win)
                {
                    GetComponent <CinematicTrigger>().Play();
                    ChangeAnimation();
                    win = false;
                }

                nestIsEmpty = true;
                toolsManager.ActivateActionInfo("Poser", requiredUsingTools, "Oeuf");
            }
        }
    }