示例#1
0
    /// <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);
    }
示例#2
0
    /// <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);
    }
示例#3
0
    // -----------------------------------------------------------------------------------.

    /// <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);
    }
示例#4
0
    static public void CreatePrefab(GameObject obj, string objName)
    {
        string path = "Assets/" + objName + "/" + objName + ".prefab";

        ViNoEditorUtil.CreatePrefab(obj, path);
    }