public static void Import(string assetPath) { GameObject gameObject = EditorUtility.CreateGameObjectWithHideFlags("", HideFlags.HideInHierarchy); string prefabFilePath = GetPrefabPath(assetPath); GameObject prefab = PrefabUtility.CreatePrefab(prefabFilePath, gameObject, ReplacePrefabOptions.ReplaceNameBased); PSBAsset asset = ScriptableObject.CreateInstance <PSBAsset>(); asset.name = Path.GetFileNameWithoutExtension(assetPath); asset.Load(assetPath); AssetDatabase.AddObjectToAsset(asset, prefabFilePath); ForkParticleEffect particleSystem = prefab.AddComponent <ForkParticleEffect>(); particleSystem.PSBFile = asset; MeshRenderer mesh = prefab.AddComponent <MeshRenderer>(); mesh.receiveShadows = false; mesh.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; mesh.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; mesh.reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; prefab.AddComponent <MeshFilter>(); GameObject.DestroyImmediate(gameObject); }
public bool ShutDownForkSDK() { if (bForkSDKShutdown) { return(true); } InvalidateObjects(); // release textures ForkParticleEffect.DestroyTextures(); // Shuts down the Fork SDK and destroy all the effects // references in the dll. bForkSDKShutdown = _frkParticlePluginSDKShutdown(); return(bForkSDKShutdown); }