// ================================================================ // // MonoBehaviour에서 상속. void Awake() { this.mojis = new List <Moji>(); foreach (var i in System.Linq.Enumerable.Range(0, this.transform.childCount)) { Moji moji = new Moji(); moji.go = this.transform.GetChild(i).gameObject; this.mojis.Add(moji); Color color = DoorMojiControl.HSVToRGB((float)i / (float)this.transform.childCount * 360.0f, 0.7f, 1.0f); moji.go.GetComponentInChildren <Renderer>().materials[0].SetColor("_MainColor", color); } // 문자순으로 정렬. this.mojis.Sort((x, y) => string.Compare(x.go.name, y.go.name)); }
// ================================================================ // // MonoBehaviour에서 상속. void Awake() { this.mojis = new List<Moji>(); foreach(var i in System.Linq.Enumerable.Range(0, this.transform.childCount)) { Moji moji = new Moji(); moji.go = this.transform.GetChild(i).gameObject; this.mojis.Add(moji); Color color = DoorMojiControl.HSVToRGB((float)i/(float)this.transform.childCount*360.0f, 0.7f, 1.0f); moji.go.GetComponentInChildren<Renderer>().materials[0].SetColor("_MainColor", color); } // 문자순으로 정렬. this.mojis.Sort((x, y) => string.Compare(x.go.name, y.go.name)); }