/// <summary> /// 開始 /// </summary> public override void Enter() { base.Enter(); //活性化 adjuster.ActivateComponent(this); //選択ポリゴンの取得 selected = adjuster.GetSelected(); //表示ポップアップの取得 if (popup == null) { popup = (ColorEditPopup)editor.ui.popup.GetUI(POPUP_NAME); if (popup == null) { //結果的にPopupが取得できないなら非活性化 adjuster.DisactivateComponent(); return; } } //コールバックの設定 popup.colorEditor.onColorChanged.AddListener(OnColorChanged); //ポップアップの表示 editor.ui.popup.IndicateUI(POPUP_NAME); //編集する色を設定 popup.colorEditor.SetColor(selected.GetPolygonColor()); }
/// <summary> /// コンテント内のポリゴンの色変更 /// </summary> private void PolyObjColorChanged(PolyPartsObject polyObj) { //Contentの取得 if (!polyObjTable.ContainsKey(polyObj)) { return; } HierarchyUIContent content = polyObjTable[polyObj]; //コンテントのメッシュの色を再設定 content.meshImage.SetColor(polyObj.GetPolygonColor()); }