/// <summary> /// 加载特效Prefab并实例化 /// </summary> /// <param name="path">相对于Resources路径下的资源路径</param> /// <param name="callBack">回调函数的参数为实例化后的GameObject对象</param> /// <param name="clearAfterLoaded">加载完成后清除自己的缓存</param> public static void LoadEffect(string path, Action <GameObject> callBack, bool clearAfterLoaded = false) { LoadResources.LoadCore(path, item => LoadResources.InstanceAsync(item.MainAsset, go => { //var arr = go.transform.GetComponentsInChildren<Renderer>(); //for (int i = 0; i < arr.Length; i++) //{ // if (arr[i].sharedMaterial != null) // arr[i].material.shader = Shader.Find(arr[i].sharedMaterial.shader.name); //} callBack(go); }), EResType.Effect, false, clearAfterLoaded); }