add y-offset functionality to start position offset

This commit is contained in:
minenice55
2022-07-29 12:52:59 -04:00
parent a583529087
commit e6e797a85e
3 changed files with 16 additions and 16 deletions

View File

@ -160,7 +160,7 @@ namespace HeavenStudio.Games
{
instance = this;
KarateManPotNew.ResetLastCombo();
cameraPosition = CameraPosition[0].position;
cameraPosition = CameraPosition[1].position;
}
private void Start()
@ -177,10 +177,10 @@ namespace HeavenStudio.Games
{
string outSound;
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSound = "karateman/objectOut";
else
if (Starpelly.Mathp.GetDecimalFromFloat(beat + 0.5f) == 0f)
outSound = "karateman/offbeatObjectOut";
else
outSound = "karateman/objectOut";
switch (type)
{
@ -188,10 +188,10 @@ namespace HeavenStudio.Games
CreateItemInstance(beat, "Item00");
break;
case (int) HitType.Lightbulb:
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSound = "karateman/lightbulbOut";
else
if (Starpelly.Mathp.GetDecimalFromFloat(beat + 0.5f) == 0f)
outSound = "karateman/offbeatLightbulbOut";
else
outSound = "karateman/lightbulbOut";
CreateItemInstance(beat, "Item01", KarateManPotNew.ItemType.Bulb);
break;
case (int) HitType.Rock:
@ -219,10 +219,10 @@ namespace HeavenStudio.Games
public void CreateBulbSpecial(float beat, int type, Color c)
{
string outSound;
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSound = "karateman/lightbulbOut";
else
if (Starpelly.Mathp.GetDecimalFromFloat(beat + 0.5f) == 0f)
outSound = "karateman/offbeatLightbulbOut";
else
outSound = "karateman/lightbulbOut";
var mobj = CreateItemInstance(beat, "Item01", KarateManPotNew.ItemType.Bulb);
if (type == (int) LightBulbType.Custom)
mobj.GetComponent<KarateManPotNew>().SetBulbColor(c);

View File

@ -86,7 +86,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
Vector3 endPosition = hitPosition - StartPositionOffset[path];
Vector3 flyPosition = new Vector3(
Mathf.Lerp(startPosition.x, endPosition.x, progress),
floorHeight + (HitPosition[path].position.y - floorHeight) * flyHeight,
floorHeight + (HitPosition[path].position.y - floorHeight + (StartPositionOffset[path].y * (1 - Mathf.Min(cond.GetPositionFromBeat(startBeat, 1f), 1f)))) * flyHeight,
Mathf.Lerp(startPosition.z, endPosition.z, progress)
);