Esempio n. 1
0
 //moves Annie in positon to throw spike
 void OnMouseDown()
 {
     PlayerPrefs.SetInt("isSelected", 1);
     GM.playInteractableEffect();
     path.setTargetPosition(posMarker.position.x, posMarker.position.y, posMarker.position.z);
     player.GetComponent <CustomPathAI>().jumpFromRightBox = true;
 }
Esempio n. 2
0
 //detects mouse click
 void OnMouseDown()
 {
     PlayerPrefs.SetInt("isSelected", 1);
     GM.playInteractableEffect();
     canCarry = true;
     path.setTargetPosition(transform.position.x, transform.position.y, transform.position.z);
 }
Esempio n. 3
0
 //makes Annie go to target
 void goToPos()
 {
     PlayerPrefs.SetInt("isSelected", 1);
     GM.playInteractableEffect();
     path.setTargetPosition(PlayerPrefs.GetFloat("newTargX"), PlayerPrefs.GetFloat("newTargY"), PlayerPrefs.GetFloat("newTargZ"));
     Debug.Log("Pillar");
 }
Esempio n. 4
0
 //detects mouse
 void OnMouseDown()
 {
     PlayerPrefs.SetInt("isSelected", 1);
     GM.playInteractableEffect();
     passOnInfo();
     path.setTargetPosition(PlayerPrefs.GetFloat("newTargX"), PlayerPrefs.GetFloat("newTargY"), PlayerPrefs.GetFloat("newTargZ"));
     Debug.Log("Jump Detector selected");
 }
Esempio n. 5
0
    void OnMouseDown()
    {
        //Make Annie go to mouse
        PlayerPrefs.SetInt("isSelected", 0);
        path.setTargetPosition(PlayerPrefs.GetFloat("newTargX"), PlayerPrefs.GetFloat("newTargY"), PlayerPrefs.GetFloat("newTargZ"));

        //Play particle affect when clicked
        lightEffect.transform.position = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        lightEffect.SetActive(true);
        lightEffect.GetComponent <ParticleSystem>().Play();
    }
Esempio n. 6
0
 //Checks which side of the box the player has clicked
 public void checkForBoxInteraction()
 {
     if (mouseInLeftBoxArea())
     {
         playerDetector.SetActive(false);
         PlayerPrefs.SetInt("isSelected", 1);
         GM.playInteractableEffect();
         Debug.Log("LeftSelected");
         passOnInfo(1);
         path.setTargetPosition(PlayerPrefs.GetFloat("newTargX"), PlayerPrefs.GetFloat("newTargY"), PlayerPrefs.GetFloat("newTargZ"));
     }
     else if (mouseInRightBoxArea())
     {
         playerDetector.SetActive(false);
         PlayerPrefs.SetInt("isSelected", 1);
         GM.playInteractableEffect();
         Debug.Log("RightSelected");
         passOnInfo(2);
         path.setTargetPosition(PlayerPrefs.GetFloat("newTargX"), PlayerPrefs.GetFloat("newTargY"), PlayerPrefs.GetFloat("newTargZ"));
     }
     else if (mouseInTopBoxArea())
     {
         playerDetector.SetActive(true);
         PlayerPrefs.SetInt("isSelected", 1);
         GM.playInteractableEffect();
         Debug.Log("TopSelected = " + PlayerPrefs.GetInt("isSelected"));
         passOnInfo(3);
         path.setTargetPosition(PlayerPrefs.GetFloat("newTargX"), PlayerPrefs.GetFloat("newTargY"), PlayerPrefs.GetFloat("newTargZ"));
     }
     //Distinguishes between pushable box or not
     else if (mouseInBoxArea() && isMovable)
     {
         playerDetector.SetActive(false);
         PlayerPrefs.SetInt("isSelected", 1);
         GM.playInteractableEffect();
         Debug.Log("BoxSelected = " + PlayerPrefs.GetInt("isSelected"));
         canPush = true;
         passOnInfo(4);
         path.setTargetPosition(PlayerPrefs.GetFloat("newTargX"), PlayerPrefs.GetFloat("newTargY"), PlayerPrefs.GetFloat("newTargZ"));
     }
 }
Esempio n. 7
0
 //check where the mouse is pressed
 void checkForBoxInteraction()
 {
     if (mouseInTopBoxArea() && playerIsOnLeftBox())
     {
         PlayerPrefs.SetInt("isSelected", 1);
         GM.playInteractableEffect();
         Debug.Log(PlayerPrefs.GetInt("isSelected"));
         passOnInfo(3);
         path.setTargetPosition(PlayerPrefs.GetFloat("newTargX"), PlayerPrefs.GetFloat("newTargY"), PlayerPrefs.GetFloat("newTargZ"));
         Debug.Log("YAAY");
         Debug.Log(PlayerPrefs.GetInt("isSelected"));
     }
 }
Esempio n. 8
0
    private void OnMouseDown()
    {
        if (leftMouseClicked())
        {
            PlayerPrefs.SetInt("isSelected", 1);
            GM.playInteractableEffect();
            if (player.transform.position.y < ObjectPos().y)
            {
                passOnInfoBase();
            }
            else if (player.transform.position.y > ObjectPos().y)
            {
                passOnInfoTop();
            }
            path.setTargetPosition(PlayerPrefs.GetFloat("newTargX"), PlayerPrefs.GetFloat("newTargY"), PlayerPrefs.GetFloat("newTargZ"));

            playerDetector.SetActive(false);
        }
    }