コード例 #1
0
    static public GameObject LoadGameObjectByResources()
    {
        if (string.IsNullOrEmpty(ResPath))
        {
            var type = typeof(T);
            ResPath = (string)ReflectionTool.GetStaticFieldValue(type, "ResPath");
        }

        GameObject prefab = Resources.Load <GameObject>(ResPath);
        GameObject go     = GameObject.Instantiate(prefab);

        return(go);
    }