更新至Unity6
This commit is contained in:
@@ -50,7 +50,7 @@ namespace Dialog
|
||||
{
|
||||
if (_instance)
|
||||
return _instance;
|
||||
_instance = FindObjectOfType<DialogManager>() ??
|
||||
_instance = FindFirstObjectByType<DialogManager>() ??
|
||||
new GameObject("DialogData").AddComponent<DialogManager>();
|
||||
return _instance;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace Dialog
|
||||
private void DialogPop(ItemDialogArgs itemDialogArgs)
|
||||
{
|
||||
var itemText = DialogManager.Instance.GetItemText(itemDialogArgs.ItemName);
|
||||
Debug.Log("ItemDialog");
|
||||
if (itemText is null) return;
|
||||
panel.SetActive(true);
|
||||
itemIcon.texture = Resources.Load<Texture2D>("Item" + "/" + itemText.Name);
|
||||
@@ -35,12 +36,13 @@ namespace Dialog
|
||||
Time.timeScale = 0;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
//todo
|
||||
/*private void Update()
|
||||
{
|
||||
if ((!panel.activeSelf || !Input.GetKeyDown(KeyCode.Escape)) &&
|
||||
!Input.GetKeyDown(KeySettingManager.Instance.GetKey("InterAct"))) return;
|
||||
Time.timeScale = 1;
|
||||
panel.SetActive(false);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace Event
|
||||
{
|
||||
if (_instance)
|
||||
return _instance;
|
||||
_instance = FindObjectOfType<EventManager>() ??
|
||||
_instance = FindFirstObjectByType<EventManager>() ??
|
||||
new GameObject("EventManager").AddComponent<EventManager>();
|
||||
return _instance;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Items
|
||||
protected override void ActivateItem()
|
||||
{
|
||||
base.ActivateItem();
|
||||
EventManager.Instance.OnDialogPop(index);
|
||||
//EventManager.Instance.OnDialogPop(index);
|
||||
EventManager.Instance.OnItemDialog(gameObject.name);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Keyboard
|
||||
{
|
||||
if (_instance)
|
||||
return _instance;
|
||||
_instance = FindObjectOfType<KeySettingManager>() ??
|
||||
_instance = FindFirstObjectByType<KeySettingManager>() ??
|
||||
new GameObject("KeySettingManager").AddComponent<KeySettingManager>();
|
||||
return _instance;
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ namespace Player
|
||||
rb.AddForce(_velocity.normalized * (Time.deltaTime * 50), ForceMode.Impulse);
|
||||
if (_velocity == Vector3.zero)
|
||||
{
|
||||
var temp = rb.velocity;
|
||||
var temp = rb.linearVelocity;
|
||||
temp = Vector3.ClampMagnitude(temp, 2);
|
||||
temp.y = rb.velocity.y;
|
||||
rb.velocity = temp;
|
||||
temp.y = rb.linearVelocity.y;
|
||||
rb.linearVelocity = temp;
|
||||
}
|
||||
|
||||
if (Input.GetKey(KeySettingManager.Instance.GetKey("Run")) &&
|
||||
@@ -46,7 +46,7 @@ namespace Player
|
||||
}
|
||||
|
||||
EventManager.Instance.OnPlayerRunning();
|
||||
rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxVelocity + 2);
|
||||
rb.linearVelocity = Vector3.ClampMagnitude(rb.linearVelocity, maxVelocity + 2);
|
||||
}
|
||||
|
||||
if (!Input.GetKey(KeySettingManager.Instance.GetKey("Run")) &&
|
||||
@@ -61,7 +61,7 @@ namespace Player
|
||||
}
|
||||
|
||||
EventManager.Instance.OnPlayerWalking();
|
||||
rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxVelocity);
|
||||
rb.linearVelocity = Vector3.ClampMagnitude(rb.linearVelocity, maxVelocity);
|
||||
}
|
||||
|
||||
if (KeySettingManager.Instance.Direction == Vector2.zero)
|
||||
|
||||
Reference in New Issue
Block a user