/// <summary> /// コンテントの追加 /// </summary> private void AddContent(PolyPartsObject polyObj) { HierarchyUIContent content = InstantiateContent(polyObj); //コンテントの追加 polyObjTable.Add(polyObj, content); }
/// <summary> /// コンテント内のポリゴンの頂点変更 /// </summary> private void PolyObjVertexChanged(PolyPartsObject polyObj) { if (!polyObjTable.ContainsKey(polyObj)) { return; } HierarchyUIContent content = polyObjTable[polyObj]; //コンテントのメッシュを再設定 content.meshImage.SetEasyMesh(polyObj.GetPolygonEasyMesh()); }
/// <summary> /// コンテントの削除 /// </summary> private void DelteContent(PolyPartsObject polyObj) { if (!polyObjTable.ContainsKey(polyObj)) { return; } polyObjTable.Remove(polyObj); //コンテントの削除 HierarchyUIContent content = polyObjTable[polyObj]; Destroy(content.gameObject); }
/// <summary> /// コンテント内のポリゴンの色変更 /// </summary> private void PolyObjColorChanged(PolyPartsObject polyObj) { //Contentの取得 if (!polyObjTable.ContainsKey(polyObj)) { return; } HierarchyUIContent content = polyObjTable[polyObj]; //コンテントのメッシュの色を再設定 content.meshImage.SetColor(polyObj.GetPolygonColor()); }
/// <summary> /// Contentの生成 /// </summary> private HierarchyUIContent InstantiateContent(PolyPartsObject polyObj) { HierarchyUIContent content = Instantiate(prefab); content.SetPolyObj(polyObj); content.meshImage.SetEasyMesh(polyObj.GetPolygonEasyMesh()); //transformの設定 RectTransform rectTrans = (RectTransform)content.transform; rectTrans.SetParent(contentsParent, false); //上に追加 rectTrans.SetAsFirstSibling(); return(content); }
/// <summary> /// コンテントのクリック /// </summary> private void OnContentClick(HierarchyUIContent content) { }