This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //DIALOGUE TRIGGER IN PLAYER | |
| //all dialogues and NPC data is made on scriptable objects | |
| if ((Input.GetButtonDown(inp.interact)|| Input.GetButtonDown(inp.c_interact)) && !ui.inDialogue) | |
| { | |
| pl.isonevent = true; //we prevent the character of doing actions | |
| ui.ClearText(); //quits all the information that could be from the last dialogue | |
| ui.SetCharNameAndColor(); //set the values for npc name, colors and dialogues | |
| ui.inDialogue = true; | |
| ui.currentVillager = currentVillager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*TOWN PROTOTYPE CODE*/ | |
| //PLAYER CONTROLLER GAMEPAD DETECTION | |
| //Get Joystick Names | |
| string[] temp = Input.GetJoystickNames(); | |
| //Check whether array contains anything | |
| if (temp.Length > 0) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //cameratilt.cs added to the main camera so in the Title Scene we can control it rotating the phone, also added some camera tilt | |
| float camtiltx; | |
| float camtiltz; | |
| float camtilty; | |
| public float rotationspeed; | |
| void Start() | |
| { | |
| Input.gyro.enabled = true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void FixedUpdate() | |
| { | |
| //writing in what situation we have to recover stamina, walking or idle while we are not making effort | |
| //the only mechanic that need to quit stamina gradually is running, every other action is done in GetKeyDown | |
| if (stamina < staminamax && fallend && !momentofdeath && canroll && !isrunning && !isattacking && !quitthestam && !stoprec) | |
| { | |
| StartCoroutine("addstamina"); | |
| } | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void tasks() | |
| { | |
| //in this if parameter we declare the range where the enemy starts following or not | |
| if (Mathf.Abs(transform.position.x - target.transform.position.x) > vision_range && !attackmode) | |
| { | |
| calm = true; | |
| } | |
| else | |
| { | |
| if (Mathf.Abs(transform.position.x - target.transform.position.x) < attack_range && !attackmode) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Start() | |
| { | |
| pl = FindObjectOfType<playercontroller>(); | |
| currentscene = SceneManager.GetActiveScene().buildIndex; //get scene int for save | |
| m_Scene = SceneManager.GetActiveScene(); //get scene name for zone text | |
| sceneName = m_Scene.name; | |
| } |