/// <summary> /// Create1s the layer. /// </summary> /// <returns> /// return the layer root Object. /// </returns> static public GameObject Create1Layer(string objName, GameObject parentObj) { string origin = ViNoToolUtil.GetAssetDataPath() + "Templates/Objects/SimpleCharacter/SimpleCharacter.prefab"; string pathWithoutExt = "Assets/" + objName + "/"; GameObject layer = CreateASimpleLayer(objName, origin, parentObj); string path = pathWithoutExt + objName + ".prefab"; ViNoEditorUtil.CreatePrefab(layer, path); return(layer); }
/// <summary> /// Create2s the layer. /// </summary> /// <returns> /// return the layer root Object. /// </returns> static public GameObject Create2Layer(string objName, GameObject parentObj) { string origin = "Assets/" + ViNoToolUtil.kAssetName + "/Templates/Objects/SimpleCharacter2/SimpleCharacter2.prefab"; string pathWithoutExt = "Assets/" + objName + "/"; GameObject clone = CreateCharaNode(objName, parentObj, origin, pathWithoutExt); float alpha = 1f; CreateCharaChild(clone, "layer1", m_CharaTex1, pathWithoutExt, alpha); alpha = 0f; CreateCharaChild(clone, "layer2", m_CharaTex2, pathWithoutExt, alpha); EditorGUIUtility.PingObject(clone); string path = pathWithoutExt + objName + ".prefab"; ViNoEditorUtil.CreatePrefab(clone, path); return(clone); }
// -----------------------------------------------------------------------------------. /// <summary> /// Creates the B. /// </summary> /// <returns> /// return the layer root Object. /// </returns> static public GameObject CreateBG(string objName, GameObject parentObj) { string origin = ViNoToolUtil.GetAssetDataPath() + "Templates/Objects/BG/SimpleBG.prefab"; string pathWithoutExt = "Assets/" + objName + "/"; GameObject clone = CreateCharaNode(objName, parentObj, origin, pathWithoutExt); EditorGUIUtility.PingObject(clone); float alpha = 1f; CreateCharaChild(clone, "layer1", m_CharaTex1, pathWithoutExt, alpha); #if false alpha = 0f; CreateCharaChild(clone, "layer2", m_CharaTex2, pathWithoutExt, alpha); #endif string path = pathWithoutExt + objName + ".prefab"; ViNoEditorUtil.CreatePrefab(clone, path); return(clone); }
static public void CreatePrefab(GameObject obj, string objName) { string path = "Assets/" + objName + "/" + objName + ".prefab"; ViNoEditorUtil.CreatePrefab(obj, path); }