コード例 #1
0
    public static GameObject GetPrefab(string name, MyPrefabType prefabType)
    {
        string     path = GetPrefabPath(prefabType);
        GameObject go   = Resources.Load(path + name) as GameObject;

        return(go);
    }
コード例 #2
0
    public static string GetPrefabPath(MyPrefabType prefabType)
    {
        switch (prefabType)
        {
        case MyPrefabType.Effect:
            return(EffectPath);

        case MyPrefabType.Card:
            return(CardPath);

        case MyPrefabType.MJ:
            return(mjPath);
        }
        return("");
    }