bugfixing after playtest; v1.4.0

This commit is contained in:
TAASONI3
2023-05-10 16:50:27 +02:00
parent 7387a4d9a5
commit 0b058f9248
12 changed files with 329 additions and 1079 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class Controls : MonoBehaviour
{
@@ -136,4 +137,6 @@ public class Controls : MonoBehaviour
fight.GetComponent<Fight>().playerAction(6);
}
}
}

View File

@@ -34,6 +34,7 @@ namespace Assets.Scripts
int openChance = new System.Random().Next(4);
if(openChance == 0){
gameObject.GetComponent<Animator>().Play("DoorOpen");
Destroy(gameObject.GetComponent<BoxCollider>());
isOpen = true;
}
else{
@@ -58,6 +59,7 @@ namespace Assets.Scripts
transform.parent.Find("chest").Find("Body").GetComponent<Chest>().loadChest(bool.Parse(json["gotItem"].ToString()));
if(isOpen){
gameObject.GetComponent<Animator>().Play("DoorOpen");
Destroy(gameObject.GetComponent<BoxCollider>());
}
}
}

View File

@@ -23,7 +23,6 @@ namespace Assets.Scripts
public GameObject introduction;
public GameObject tooltip;
public GameObject tutorial;
public GameObject buttonsHUD;
public GameObject inventory;
public GameObject waterLayer;
@@ -107,7 +106,7 @@ namespace Assets.Scripts
introduction.transform.localScale = new Vector3(0, 0, 0);
tutorial.transform.localScale = new Vector3(1, 1, 1);
showHUD();
state = UIState.GAME;
state = UIState.TUTORIAL;
}
public void switchCharactersheet()
@@ -171,6 +170,7 @@ namespace Assets.Scripts
public void closeInventory()
{
inventory.GetComponent<Inventory>().OnMouseUp();
inventory.transform.localScale = new Vector3(0, 0, 0);
showHUD();
state = UIState.GAME;
@@ -194,7 +194,6 @@ namespace Assets.Scripts
{
playerHUD.transform.localScale = new Vector3(1,1,1);
compass.transform.localScale = new Vector3(1, 1, 1);
buttonsHUD.transform.localScale = new Vector3(1, 1, 1);
}
public void openMainMenu()
@@ -204,7 +203,7 @@ namespace Assets.Scripts
public void switchPauseMenu()
{
if (state == UIState.GAME || state == UIState.CHARACTER || state == UIState.PAUSE || state == UIState.QUEST)
if (state == UIState.GAME || state == UIState.CHARACTER || state == UIState.PAUSE || state == UIState.QUEST || state == UIState.INVENTORY || state == UIState.INTRODUCTION)
{
if (state == UIState.PAUSE)
{
@@ -533,7 +532,7 @@ namespace Assets.Scripts
GameObject.Find("Player").GetComponent<Player>().generatePlayer();
GameObject.Find("Player").GetComponent<Player>().finishPlayerCreation();
hideOtherElements(introduction);
state = UIState.TUTORIAL;
state = UIState.INTRODUCTION;
}
else
{
@@ -550,6 +549,7 @@ namespace Assets.Scripts
public void closeTutorial()
{
tutorial.transform.localScale = new Vector3(0,0,0);
state = UIState.GAME;
}
}
}

View File

@@ -382,5 +382,12 @@ namespace Assets.Scripts
}
}
}
public void OnMouseUp(){
if(dragImage.GetComponent<RawImage>().texture != null){
dragImage.GetComponent<RawImage>().color = new Color(0,0,0,0);
dragImage.GetComponent<RawImage>().texture = null;
dragImage.transform.position = new Vector3(0,0,0);
}
}
}
}

View File

@@ -110,7 +110,7 @@ namespace Assets.Scripts
{
inventory.dragImage.GetComponent<RawImage>().color = toMove.rarityColor;
inventory.dragImage.GetComponent<RawImage>().texture = toMove.image;
inventory.dragImage.transform.position = new Vector3(Input.mousePosition.x - 50, Input.mousePosition.y - 50, 0);
inventory.dragImage.transform.position = new Vector3(Input.mousePosition.x + 50, Input.mousePosition.y - 50, 0);
}
}

View File

@@ -11,8 +11,8 @@ namespace Assets.Scripts
GameObject player;
Vector2 rotation = Vector2.zero;
public float speed = 1; //the sensibility
public float xMaxLimit = 25.0f;
public float xMinLimit = -25.0f;
public float xMaxLimit = 5.0f;
public float xMinLimit = -5.0f;
GameObject interact;
// Start is called before the first frame update
@@ -26,13 +26,17 @@ namespace Assets.Scripts
// Update is called once per frame
void Update()
{
{
if(uihandler.canPlayerRotate()){
Cursor.lockState = CursorLockMode.Locked;
rotation.y += Input.GetAxis("Mouse X");
rotation.x += -Input.GetAxis("Mouse Y");
rotation.x = Mathf.Clamp(rotation.x, xMinLimit, xMaxLimit);
transform.eulerAngles = (Vector2)rotation * speed;
}
else{
Cursor.lockState = CursorLockMode.Confined;
}
transform.position = new Vector3(transform.parent.transform.position.x, transform.position.y, transform.parent.transform.position.z);
}

View File

@@ -17,6 +17,7 @@ namespace Assets.Scripts
PAUSEOPTIONS,
TUTORIAL,
QUEST,
INVENTORY
INVENTORY,
INTRODUCTION
}
}