Compare commits

..

No commits in common. "142e43c9f83308aa5ca1d6e995ba357b0fdad6bb" and "9a24d4d7aa53e4fe6f3631be91d4a351f046cfa2" have entirely different histories.

View File

@ -35,10 +35,8 @@ public class PlayerManager : MonoBehaviour
private float saveRunSpeed; private float saveRunSpeed;
private float saveJump; private float saveJump;
private Vector3 saveSize; private Vector3 saveSize;
private Vector3 saveNewSize;
private Vector3 savePosition; private Vector3 savePosition;
private Vector3 saveCameraPosition; private Vector3 saveCameraPosition;
private float savePower;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
@ -51,6 +49,8 @@ public class PlayerManager : MonoBehaviour
saveRunSpeed = runSpeed; saveRunSpeed = runSpeed;
saveJump = jump; saveJump = jump;
saveSize = transform.localScale; saveSize = transform.localScale;
savePosition = transform.localPosition;
saveCameraPosition = Camera.main.transform.localPosition;
} }
// Update is called once per frame // Update is called once per frame
@ -92,11 +92,6 @@ public class PlayerManager : MonoBehaviour
powerCubeManager.transform.localScale = Vector3.Slerp(powerCubeManager.transform.localScale, new Vector3(0.01f, 0.01f, 0.01f), stepSmaller); powerCubeManager.transform.localScale = Vector3.Slerp(powerCubeManager.transform.localScale, new Vector3(0.01f, 0.01f, 0.01f), stepSmaller);
} }
} }
if (actualPowerTimes[0] != 0f && actualPowerTimes[0] > Time.time)
{
transform.localScale = Vector3.Slerp(transform.localScale, saveNewSize, 1 * Time.deltaTime);
}
} }
private void FixedUpdate() private void FixedUpdate()
@ -293,22 +288,24 @@ public class PlayerManager : MonoBehaviour
if (powerType == PowerCubeManager.PowerType.Bigger) if (powerType == PowerCubeManager.PowerType.Bigger)
{ {
saveSize = transform.localScale; saveSize = transform.localScale;
savePower = power; savePosition = transform.localPosition;
saveNewSize = new Vector3( saveCameraPosition = Camera.main.transform.localPosition;
transform.localScale.x + savePower,
transform.localScale.y + savePower, transform.localScale = new Vector3(
transform.localScale.z + savePower
);
/*transform.localScale = new Vector3(
transform.localScale.x + power, transform.localScale.x + power,
transform.localScale.y + power, transform.localScale.y + power,
transform.localScale.z + power transform.localScale.z + power
);*/ );
/*transform.localPosition = new Vector3( transform.localPosition = new Vector3(
transform.localPosition.x, transform.localPosition.x,
transform.localPosition.y + power * 2, transform.localPosition.y + power * 2,
transform.localPosition.z transform.localPosition.z
);*/ );
Camera.main.transform.localPosition = new Vector3(
Camera.main.transform.localPosition.x,
Camera.main.transform.localPosition.y,
Camera.main.transform.localPosition.z - power * 2
);
} }
else if (powerType == PowerCubeManager.PowerType.Faster) else if (powerType == PowerCubeManager.PowerType.Faster)
@ -332,11 +329,11 @@ public class PlayerManager : MonoBehaviour
{ {
if (actualPowerTimes[0] != 0f && actualPowerTimes[0] < Time.time) if (actualPowerTimes[0] != 0f && actualPowerTimes[0] < Time.time)
{ {
transform.localScale = Vector3.Slerp(transform.localScale, saveSize, 1 * Time.deltaTime); transform.localScale = saveSize;
if (transform.localScale == saveSize) { transform.localPosition = savePosition;
Camera.main.transform.localPosition = saveCameraPosition;
actualPowerTimes[0] = 0f; actualPowerTimes[0] = 0f;
} }
}
if (actualPowerTimes[1] != 0f && actualPowerTimes[1] < Time.time) if (actualPowerTimes[1] != 0f && actualPowerTimes[1] < Time.time)
{ {
speed = saveSpeed; speed = saveSpeed;