//When clicked, this public void AssignSkin(SkinSlot slot) { instrument = slot.skin.instrument; if (instrument == 1) { Image image = drumDecoObjReal.GetComponent <Image>(); //Pitää tehdä TAIIIIIIIIKATEMPPUJA Color newColor = drumDecoObjReal.GetComponent <Image>().color; newColor = slot.skin.color; image.color = newColor; /*foreach (Transform deco in drumDecoObj) * { * deco.GetComponent<Image>().color = slot.skin.color; * print("nailed it"); * }*/ } else if (instrument == 2) { guitarBGObj.GetComponent <Image>().color = slot.skin.color; print("nailed it here, as well"); } else if (instrument == 3) { pianoBGObj.GetComponent <Image>().color = slot.skin.color; print("nailing anywhere, anyday"); } if (slot.skin.trinket == true) { //Add stuffs } //change (/add?) trinkets }
// used by Skinning class public Color GetSkin(SkinTag tag) { if (skin_slots == null || skin_slots.Count < 0) { Debug.LogError("<b>[SkinData]</b> : Skin slots are not setup"); return(Color.magenta); } SkinSlot slot = skin_slots.Find((item) => { return(tag == item.tag); }); if (slot != null) { return(slot.color); } else { return(Color.black); } }
public void FixSlots() { if (skin_slots == null) { skin_slots = new List <SkinSlot>(); } int index = 0; foreach (SkinTag tag in Enum.GetValues(typeof(SkinTag))) { SkinSlot slot = skin_slots.Find((item) => { return(item.tag == tag); }); if (slot == null) { skin_slots.Insert(index, new SkinSlot(tag, Color.black)); } index++; } }