public void UpdateMaterialAnimation(GalaxyPrefab prefab, float speed, bool Animate) { if (prefab != null && m_material != null) { //m_material.SetInt("Animate", Animate ? 1 : 0); //m_material.SetFloat("AnimationSpeed", speed); } }
/// <summary> /// Generate the particle data as well as the mesh /// </summary> /// <param name="Prefab">The Particle prefab to use</param> /// <param name="galaxy">The galaxy prefab</param> /// <param name="gpu">Should the generation be using the GPU acceleration</param> public void Generate(ParticlesPrefab Prefab, GalaxyPrefab galaxy, bool gpu) { this.m_prefab = Prefab; this.m_galaxyPrefab = galaxy; this.m_gpu = gpu; UpdateParticleList(); UpdateMeshes(); }
/// <summary> /// Default constructor /// </summary> /// <param name="particle"></param> /// <param name="galaxy"></param> /// <param name="particles"></param> /// <param name="time"></param> /// <param name="index"></param> public ProcessContext(Particle particle, GalaxyPrefab galaxy, ParticlesPrefab particles, float time, float index) { this.particle = particle; this.galaxy = galaxy; this.particles = particles; this.time = time; this.index = index; }
/// <summary> /// Sets the Height Map. This map controls the height of the particles. /// </summary> /// <param name="texture"></param> public void SetHeightMap(Texture2D texture) { if (HeightMap != texture) { HeightMap = texture; GalaxyPrefab.RecreateAllGalaxies(); } }
/// <summary> /// Sets the Color Map. This map controls the color of the particles. /// </summary> /// <param name="texture"></param> public void SetColorMap(Texture2D texture) { if (ColorMap != texture) { ColorMap = texture; GalaxyPrefab.RecreateAllGalaxies(); } }
/// <summary> /// Sets the Distribution map. This map controls the distribution of the particles. /// </summary> /// <param name="texture"></param> public void SetDistributionMap(Texture2D texture) { if (DistributionMap != texture) { DistributionMap = texture; RecreateCurves(); GalaxyPrefab.RecreateAllGalaxies(); } }
/// <summary> /// Generates <see cref="Galaxia.Particles"/> to all the <see cref="Galaxia.ParticlesPrefab"/> in the galaxy /// </summary> /// <remarks> /// This function only generates the particles, not the Meshes /// </remarks> public void GenerateParticles() { DestroyParticles(); if (!GalaxyPrefab) { return; } foreach (ParticlesPrefab prefab in GalaxyPrefab.Where(prefab => prefab != null)) { GenerateParticles(prefab); } }
/// <summary> /// Updates the Particles Prefab Internal material. With all the uniform variables from the given Galaxy Prefab. /// </summary> /// <param name="prefab">The Galaxy Prefab</param> /// <param name="color">The overlay color of the stars</param> public void UpdateMaterial(GalaxyPrefab prefab, Color color) { if (m_material == null) { CreateMaterial(prefab, false); } if (prefab != null && m_material != null) { m_material.mainTexture = Texture; m_material.color = m_colorOverlay * color; m_material.SetFloat("MaxScreenSize", MaxScreenSize); m_material.SetInt("TextureSheetPower", m_textureSheetPower); m_material.SetInt("MySrcMode", (int)m_blendModeSrc); m_material.SetInt("MyDstMode", (int)m_blendModeDis); m_material.renderQueue = m_renderQueue; } }
internal void CreateMaterial(GalaxyPrefab prefab, bool GPU) { if (m_material != null) { DestroyImmediate(m_material, true); } Shader s = prefab.shaderBruteForce; if (Galaxy.SupportsDirectX11) { s = prefab.shader; } else if (Galaxy.OpenGL) { s = prefab.shaderBruteForceGLSL; } m_material = new Material(s) { hideFlags = HideFlags.DontSave }; }
/// <summary> /// Used to assign a Galaxy Prefab. /// </summary> /// <param name="prefab"></param> public void SetUp(GalaxyPrefab prefab) { m_galaxyPrefab = prefab; }
/// <summary> /// Updates the Particles Prefab Internal material. With all the uniform variables from the given Galaxy Prefab. /// </summary> /// <param name="prefab">The Galaxy Prefab</param> public void UpdateMaterial(GalaxyPrefab prefab) { UpdateMaterial(prefab, UnityEngine.Color.white); }
internal void SetGalaxyPrefab(GalaxyPrefab galaxyPrefab) { m_galaxyPrefab = galaxyPrefab; }