private void PutOnBottom(ClothingBottom bottom) { lowerSpineMesh.sharedMesh = bottom.lowerSpineMesh; leftHipMesh.sharedMesh = bottom.hipMesh; rightHipMesh.sharedMesh = bottom.hipMesh; leftKneeMesh.sharedMesh = bottom.kneeMesh; rightKneeMesh.sharedMesh = bottom.kneeMesh; lowerSpineMesh.GetComponent <MeshRenderer>().sharedMaterial = bottom.lowerSpine; leftHipMesh.GetComponent <MeshRenderer>().sharedMaterial = bottom.legs; rightHipMesh.GetComponent <MeshRenderer>().sharedMaterial = bottom.legs; leftKneeMesh.GetComponent <MeshRenderer>().sharedMaterial = bottom.legs; rightKneeMesh.GetComponent <MeshRenderer>().sharedMaterial = bottom.legs; }
public static void CreateClothingBottom() { ClothingBottom asset = ScriptableObject.CreateInstance <ClothingBottom>(); string path = AssetDatabase.GetAssetPath(Selection.activeObject); if (path == "") { path = "Assets"; } else if (Path.GetExtension(path) != "") { path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), ""); } AssetDatabase.CreateAsset(asset, path + "/NewClothingBottom.asset"); AssetDatabase.SaveAssets(); EditorUtility.FocusProjectWindow(); Selection.activeObject = asset; }
public void SetBottom(ClothingBottom bottom) { PutOnBottom(bottom); }