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