ui Changes
This commit is contained in:
@@ -10,20 +10,21 @@ public class BuildingManager : MonoBehaviour
|
||||
|
||||
public void BuildingInteract(IndoorSO indoor)
|
||||
{
|
||||
IsOpen = CheckIsOpen(indoor.OpenHoursFrom, indoor.OpenHoursTo);
|
||||
|
||||
if (!IsInside)
|
||||
{
|
||||
EnterBuilding(indoor);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitBuilding();
|
||||
ExitBuilding(indoor);
|
||||
}
|
||||
}
|
||||
|
||||
private void EnterBuilding(IndoorSO indoor)
|
||||
{
|
||||
if(IsOpen)
|
||||
IsOpen = CheckIsOpen(indoor?.OpenHoursFrom, indoor?.OpenHoursTo);
|
||||
if (IsOpen)
|
||||
{
|
||||
Indoor = indoor;
|
||||
IsInside = true;
|
||||
@@ -31,14 +32,19 @@ public class BuildingManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void ExitBuilding()
|
||||
public void ExitBuilding(IndoorSO indoor)
|
||||
{
|
||||
GameManager.Instance.Scene.Change("city");
|
||||
IsInside = false;
|
||||
GameManager.Instance.Scene.Change("city",indoor.BuidingName);
|
||||
}
|
||||
|
||||
private bool CheckIsOpen(int from, int to)
|
||||
private bool CheckIsOpen(int? from, int? to)
|
||||
{
|
||||
return GameManager.Instance.Time.CurrentTime.Hours >= from
|
||||
&& GameManager.Instance.Time.CurrentTime.Hours <= to;
|
||||
if (from.HasValue && to.HasValue)
|
||||
{
|
||||
return GameManager.Instance.Time.CurrentTime.Hours >= from
|
||||
&& GameManager.Instance.Time.CurrentTime.Hours <= to;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,8 +145,7 @@ public class CameraSystem : MonoBehaviour
|
||||
|
||||
private void HandleCameraMovement(Vector2 inputDir)
|
||||
{
|
||||
|
||||
Vector3 moveDir = transform.forward * -inputDir.y + transform.right * -inputDir.x;
|
||||
Vector3 moveDir = transform.forward * inputDir.y + transform.right * inputDir.x;
|
||||
transform.position += moveDir * _moveSpeed * Time.deltaTime;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,8 @@ public class InGameMouseHandler : UnityEngine.Object
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (Mouse.current.leftButton.wasPressedThisFrame)
|
||||
|
||||
if (GameManager.Instance.Input.PlayerAction.PointClick.WasPressedThisFrame())
|
||||
{
|
||||
ClickToMove(!EventSystem.current.IsPointerOverGameObject());
|
||||
}
|
||||
|
||||
@@ -49,6 +49,17 @@ public partial class @InputActions: IInputActionCollection2, IDisposable
|
||||
""action"": ""PointClick"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""25a11c76-9acb-4544-bf8f-121962b3bf0b"",
|
||||
""path"": ""<Gamepad>/buttonSouth"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""PointClick"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -26,6 +26,17 @@
|
||||
"action": "PointClick",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "25a11c76-9acb-4544-bf8f-121962b3bf0b",
|
||||
"path": "<Gamepad>/buttonSouth",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "PointClick",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -9,8 +9,9 @@ public class SceneManager
|
||||
UnityEngine.SceneManagement.SceneManager.sceneLoaded += SceneManager_sceneLoaded;
|
||||
}
|
||||
|
||||
public void Change(string sceneName)
|
||||
public void Change(string sceneName,string spawnName= "DefaultStartPoint")
|
||||
{
|
||||
_spawnLocationName = spawnName;
|
||||
UnityEngine.SceneManagement.SceneManager.LoadScene(sceneName);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RadialMenuItem : MonoBehaviour
|
||||
float posX = Mathf.Sin(theta);
|
||||
float posY = Mathf.Cos(theta);
|
||||
|
||||
button.transform.localPosition = new Vector3(posX, posY, 0) * 150f;
|
||||
button.transform.localPosition = new Vector3(posX, posY, 0) * 50f;
|
||||
|
||||
var textMeshPro = button.GetComponentInChildren<TextMeshProUGUI>();
|
||||
if (textMeshPro != null)
|
||||
|
||||
Reference in New Issue
Block a user