diff --git a/Assets/Resources/Games/karateman.prefab b/Assets/Resources/Games/karateman.prefab index 10670be0d..c2447e8a5 100644 --- a/Assets/Resources/Games/karateman.prefab +++ b/Assets/Resources/Games/karateman.prefab @@ -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 diff --git a/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs b/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs index 13b802016..76e4beb4e 100644 --- a/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs +++ b/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs @@ -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(); } } } \ No newline at end of file