예제 #1
0
 public void OnMouseDown()
 {
     if (Input.GetMouseButtonDown(0))
     {
         if (player.canWalk)
         {
             clickedOnSomething = true;
             player.setTarget(new Vector3(transform.position.x, transform.position.y, 0));
         }
     }
 }
예제 #2
0
 public void OnMouseDown()
 {
     if (Input.GetMouseButtonDown(0))
     {
         if (player != null)
         {
             if (player.canWalk && !wall)
             {
                 clickedOnSomething = true;
                 player.setTarget(new Vector3(transform.position.x, transform.position.y, 0));
             }
             else if (!player.talking)
             {
                 player.stopMove();
                 player.canWalk     = true;
                 clickedOnSomething = true;
             }
         }
     }
 }
        public static void endDialogue()
        {
            if (onEndCallback != null)
            {
                onEndCallback();
            }

            // Dispatch onEnd event
            DialoguerEventManager.dispatchOnWindowClose();

            // Dispatch onEnd event
            DialoguerEventManager.dispatchOnEnded();

            // Reset current dialogue
            dialogue.Reset();

            // Clean up
            reset();

            //Debug.LogError ("DANGER");
            GameManager.dialogueJustFinished = true;
            if (GameManager.Instance.playerInScene)
            {
                playerScript temp = (playerScript)MonoBehaviour.FindObjectOfType(typeof(playerScript));
                if (temp != null)
                {
                    temp.canWalk  = true;
                    temp.walkWait = 30;
                    temp.talking  = false;
                    if (temp.anim != null)
                    {
                        temp.anim.SetFloat("distance", 0f);
                    }
                    temp.setTarget(new Vector2(temp.transform.position.x, temp.transform.position.y));
                }
            }
        }