small fixes
This commit is contained in:
@@ -28,15 +28,11 @@ public class SceneManager
|
|||||||
if (spawn.name.ToLower() == _spawnLocationName.ToLower())
|
if (spawn.name.ToLower() == _spawnLocationName.ToLower())
|
||||||
{
|
{
|
||||||
var interactable = spawn.GetComponent<BaseInteractableObject>();
|
var interactable = spawn.GetComponent<BaseInteractableObject>();
|
||||||
Player.Instance.SetPosition(interactable._interactionPoint.position);
|
Player.Instance.SetPosition(interactable._interactionPoint);
|
||||||
Player.Instance.Rotate(interactable._interactionPoint.forward * -1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Player.Instance.SetPosition(Vector3.zero);
|
|
||||||
}
|
|
||||||
GameManager.Instance.Camera.ResetToPlayerPosition();
|
GameManager.Instance.Camera.ResetToPlayerPosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public abstract class BaseCharacter : MonoBehaviour
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TaskStatus Rotate(Vector3 target)
|
protected TaskStatus Rotate(Vector3 target)
|
||||||
{
|
{
|
||||||
var targetRot = Quaternion.LookRotation(target);
|
var targetRot = Quaternion.LookRotation(target);
|
||||||
Quaternion rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(target), 10 * Time.deltaTime);
|
Quaternion rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(target), 10 * Time.deltaTime);
|
||||||
|
|||||||
@@ -51,10 +51,11 @@ public class Player : BaseCharacter
|
|||||||
GameManager.Instance.Time.OnMinuteChanged -= UpdateStatsByClock;
|
GameManager.Instance.Time.OnMinuteChanged -= UpdateStatsByClock;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPosition(Vector3 desiredPosition)
|
public void SetPosition(Transform desiredPosition)
|
||||||
{
|
{
|
||||||
_navAgent.Warp(desiredPosition);
|
_navAgent.Warp(desiredPosition.position);
|
||||||
_navAgent.updatePosition = false;
|
_navAgent.updatePosition = false;
|
||||||
|
Rotate(desiredPosition.forward * -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GoToPoint(BaseInteractableObject point)
|
public void GoToPoint(BaseInteractableObject point)
|
||||||
|
|||||||
Reference in New Issue
Block a user