save position and cam rotation
This commit is contained in:
@@ -13,7 +13,7 @@ public override void Use()
|
||||
newBall.transform.position = transform.position;
|
||||
|
||||
Vector3 direction = transform.forward * shootForce;
|
||||
direction += GameManager.Instance.GetPlayerController().GetVelocity();
|
||||
direction += GameManager.Instance.PlayerController.GetVelocity();
|
||||
|
||||
newBall.GetComponent<Rigidbody>().AddForce(direction, ForceMode.Impulse);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ private void Start()
|
||||
|
||||
IEnumerator GoToTarget(Vector3 target)
|
||||
{
|
||||
GameManager.Instance.GetPlayerController().SetCharacterControl(false);
|
||||
GameManager.Instance.PlayerController.SetCharacterControl(false);
|
||||
isMoving = true;
|
||||
Vector3 startPosition = hook.transform.position;
|
||||
float elapsedTime = 0f;
|
||||
@@ -45,7 +45,7 @@ IEnumerator GoToTarget(Vector3 target)
|
||||
|
||||
IEnumerator MovePlayerToTarget(Vector3 target)
|
||||
{
|
||||
Transform player = GameManager.Instance.GetPlayerController().transform;
|
||||
Transform player = GameManager.Instance.PlayerController.transform;
|
||||
Vector3 startPosition = player.position;
|
||||
float elapsedTime = 0f;
|
||||
|
||||
@@ -66,12 +66,12 @@ IEnumerator MovePlayerToTarget(Vector3 target)
|
||||
isMoving = false;
|
||||
stuckInTarget = false;
|
||||
|
||||
GameManager.Instance.GetPlayerController().SetCharacterControl(true);
|
||||
GameManager.Instance.PlayerController.SetCharacterControl(true);
|
||||
}
|
||||
|
||||
IEnumerator ShootAndMiss()
|
||||
{
|
||||
GameManager.Instance.GetPlayerController().SetCharacterControl(false);
|
||||
GameManager.Instance.PlayerController.SetCharacterControl(false);
|
||||
|
||||
isMoving = true;
|
||||
|
||||
@@ -92,7 +92,7 @@ IEnumerator ShootAndMiss()
|
||||
isMoving = false;
|
||||
stuckInTarget = false;
|
||||
|
||||
GameManager.Instance.GetPlayerController().SetCharacterControl(true);
|
||||
GameManager.Instance.PlayerController.SetCharacterControl(true);
|
||||
}
|
||||
|
||||
public override void Use()
|
||||
@@ -105,7 +105,7 @@ public override void Use()
|
||||
isMoving = false;
|
||||
stuckInTarget = false;
|
||||
|
||||
GameManager.Instance.GetPlayerController().SetCharacterControl(true);
|
||||
GameManager.Instance.PlayerController.SetCharacterControl(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ThrowableHand : Tool
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (GameManager.Instance.GetPlayerController() != null)
|
||||
if (GameManager.Instance.PlayerController != null)
|
||||
{
|
||||
SetGroundPlane();
|
||||
DrawTargetProjection();
|
||||
@@ -29,10 +29,10 @@ private void SetGroundPlane()
|
||||
{
|
||||
if (handGroundPlane == null)
|
||||
{
|
||||
handGroundPlane = new Plane(Vector3.up, -GameManager.Instance.GetPlayerController().DougBody.transform.position.y);
|
||||
handGroundPlane = new Plane(Vector3.up, -GameManager.Instance.PlayerController.DougBody.transform.position.y);
|
||||
}
|
||||
|
||||
handGroundPlane.distance = -GameManager.Instance.GetPlayerController().DougBody.transform.position.y;
|
||||
handGroundPlane.distance = -GameManager.Instance.PlayerController.DougBody.transform.position.y;
|
||||
handGroundPlane.normal = Vector3.up;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public override void Use()
|
||||
newBomb.transform.position = transform.position;
|
||||
|
||||
Vector3 direction = transform.forward * throwForce * forceModifier;
|
||||
direction += GameManager.Instance.GetPlayerController().GetVelocity();
|
||||
direction += GameManager.Instance.PlayerController.GetVelocity();
|
||||
direction.y = loft;
|
||||
|
||||
newBomb.GetComponent<Rigidbody>().AddForce(direction, ForceMode.Impulse);
|
||||
|
||||
Reference in New Issue
Block a user