set correct heart colours

This commit is contained in:
minenice55 2022-08-12 22:06:43 -04:00
parent dc9b6a7991
commit 03e26c4efb
2 changed files with 45 additions and 0 deletions

View file

@ -67123,6 +67123,12 @@ MonoBehaviour:
NoriHeart: {fileID: 4687146461093134549}
NoriHolder: {fileID: 2451790077583954414}
NoriMaterial: {fileID: 2100000, guid: b1a39ae83b8f3994ea5ea73e28b253a8, type: 2}
NoriColorsTengoku:
- {r: 0.13333334, g: 0.4, b: 1, a: 1}
- {r: 0.007843138, g: 0.9019608, b: 0.9098039, a: 1}
- {r: 1, g: 0.09411765, b: 0, a: 1}
- {r: 0.9843137, g: 0.92941177, b: 0, a: 1}
NoriColorsMania: []
Nori: 0
MaxNori: 0
--- !u!1 &4608551727560295043

View file

@ -14,6 +14,9 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public Transform NoriHolder;
public Material NoriMaterial;
public Color[] NoriColorsTengoku;
public Color[] NoriColorsMania;
public float Nori;
public int MaxNori;
Animator[] NoriHeartAnimators;
@ -96,6 +99,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
if (Nori >= MaxNori) return;
Nori += 1;
NoriHeartAnimators[(int) Nori - 1].Play("NoriFull", -1, (Time.time * PeriodHigh) % 1f);
UpdateHeartColours();
}
}
@ -107,6 +111,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
if (Nori <= 0) return;
Nori -= 1;
NoriHeartAnimators[(int) Nori].Play("NoriNone", -1, (Time.time * PeriodLow) % 1f);
UpdateHeartColours();
}
}
@ -123,6 +128,38 @@ namespace HeavenStudio.Games.Scripts_KarateMan
}
}
void UpdateHeartColours()
{
if (noriMode == (int) KarateMan.NoriMode.None) return;
if (noriMode == (int) KarateMan.NoriMode.Tengoku)
{
for (int i = 0; i < NoriHeartMaterials.Length; i++)
{
Material mat = NoriHeartMaterials[i];
if (Nori == MaxNori)
{
mat.SetColor("_ColorAlpha", NoriColorsTengoku[3]);
}
else
{
if (KarateMan.instance.NoriPerformance < 0.6)
mat.SetColor("_ColorAlpha", NoriColorsTengoku[0]);
else
{
if (i < 2)
mat.SetColor("_ColorAlpha", NoriColorsTengoku[1]);
else
mat.SetColor("_ColorAlpha", NoriColorsTengoku[2]);
}
}
}
}
else
{
}
}
void Update()
{
Transform target = GameCamera.instance.transform;
@ -130,6 +167,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan
Vector3 displacement = target.forward * CameraOffset;
transform.position = target.position + displacement;
transform.rotation = target.rotation;
UpdateHeartColours();
}
}
}