add y-offset functionality to start position offset

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

View file

@ -1654,7 +1654,7 @@ SpriteRenderer:
m_Size: {x: 5.12, y: 5.12}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_WasSpriteAssigned: 0
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &2977027034337794333
@ -1737,7 +1737,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &5764267227668832721
Transform:
m_ObjectHideFlags: 0
@ -2725,14 +2725,14 @@ MonoBehaviour:
- 0
- 0.65
- 0.825
- 0.999
- 0.65
- 0.8
- 0.625
StartPositionOffset:
- {x: 1.5, y: 0, z: -9}
- {x: 1.5, y: 0, z: -8}
- {x: 1, y: 0, z: -8.75}
- {x: -2.25, y: 0, z: -9.5}
- {x: -2.5, y: 4, z: -9.5}
- {x: 0.25, y: 0, z: -8.5}
- {x: 2.25, y: 0, z: -9.5}
ItemSlipRt:
@ -3711,7 +3711,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7505887227269335280}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.92, y: -3.75, z: 0}
m_LocalPosition: {x: 0.92, y: -3.5, z: 0}
m_LocalScale: {x: 0.64, y: 0.64, z: 1}
m_Children: []
m_Father: {fileID: 5764267227668832721}

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)
);