public static void SetArmor(GameObject player, BottomArmor topArmor) { if (topArmor == null) { Transform Back = player.transform.FindChild("Character").FindChild("Armature"); Back.FindChild("RightBelt").gameObject.SetActive(false); Back.FindChild("LeftBelt").gameObject.SetActive(false); } else { Transform Back = player.transform.FindChild("Character").FindChild("Armature"); Transform RightBelt = Back.FindChild("RightBelt"); Transform LeftBelt = Back.FindChild("LeftBelt"); LeftBelt.gameObject.SetActive(true); RightBelt.gameObject.SetActive(true); LeftBelt.GetComponent<MeshRenderer>().materials = new Material[] { topArmor.Exterieur, topArmor.Interieur }; RightBelt.GetComponent<MeshRenderer>().materials = new Material[] { topArmor.Exterieur, topArmor.Interieur }; } }
public BottomArmor(BottomArmor bottomArmor) : base(bottomArmor) { }