This commit is contained in:
2026-03-19 06:31:08 +01:00
parent 2804acb9fb
commit 8735498b8f
97 changed files with 63618 additions and 34 deletions

View File

@@ -6,6 +6,8 @@ public class PlayerVisual : MonoBehaviour
[System.Serializable]
private class Customization
{
public int HeadID;
public int BodyID;
[ColorUsage(false, true)] public Color[] Colors;
}
@@ -16,6 +18,8 @@ public class PlayerVisual : MonoBehaviour
public Animator Anim;
public Renderer[] Renderers;
public Material[] Materials;
public GameObject[] HeadAccessories;
public GameObject[] BodyAccessories;
}
[System.Serializable]
@@ -52,6 +56,13 @@ public class PlayerVisual : MonoBehaviour
{
float hueShift = Random.Range(0f, 360f);
// Accessories
_customization.HeadID = Random.Range(0, _references.HeadAccessories.Length + 1);
_customization.BodyID = Random.Range(0, _references.BodyAccessories.Length + 1);
// Colors
_customization.Colors = new Color[_references.Materials.Length];
for (int i = 0; i < _customization.Colors.Length; i++)
@@ -72,6 +83,16 @@ public class PlayerVisual : MonoBehaviour
private void SetCustom()
{
// Accessories
for (int i = 0; i < _references.HeadAccessories.Length; i++)
_references.HeadAccessories[i].SetActive(i == _customization.HeadID);
for (int i = 0; i < _references.BodyAccessories.Length; i++)
_references.BodyAccessories[i].SetActive(i == _customization.BodyID);
// Colors
foreach (Renderer rend in _references.Renderers)
{
foreach (Material mat in rend.materials)