// Use this for initialization void Start() { col = new ColorHSV { A = 100.0f, H = Random.value * 360.0f, S = Random.value * 100.0f, V = Random.value * 100.0f }; syst = GetComponent <TCParticleSystem>(); syst.ParticleRenderer.Material.SetColor("_TintColor", col.ToColor()); }
public TCWireframeDrawer(TCParticleSystem system) { m_partSyst = system; m_lineMat = new Material( "Shader \"Lines/Colored Blended\" { SubShader { Pass { Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Front Fog { Mode Off } } } }") { hideFlags = HideFlags.HideAndDontSave, shader = {hideFlags = HideFlags.HideAndDontSave} }; BuildLineMesh(); }
internal void Awake(TCParticleSystem comp) { //reference all components for easy acess SystemComp = comp; ComputeShader = TCParticleGlobalManager.Instance.ComputeShader; //find all kernels for quick acces. UpdateAllKernel = ComputeShader.FindKernel("UpdateAll"); EmitKernel = ComputeShader.FindKernel("Emit"); ClearKernel = ComputeShader.FindKernel("Clear"); UpdateForcesKernel = ComputeShader.FindKernel("UpdateForces"); UpdateTurbulenceForcesKernel = ComputeShader.FindKernel("UpdateTurbulenceForces"); UpdateCollidersKernel = ComputeShader.FindKernel("UpdateColliders"); Initialize(); }
void OnEnable() { //Cache reference to m_system = GetComponent <TCParticleSystem>(); //Count is max nr. of particles the system can have. Buffer contains float3 -> so a stride of 4 * 3 = 12 bytes m_initialPositions = new ComputeBuffer(m_system.MaxParticles, 12); //Whenever we emit new particles, we need to update our initial position buffer m_system.Emitter.OnEmissionCallback += OnEmissionCallback; //After emission we need to run our code applying the spring force m_system.Manager.OnPostSimulationCallback += OnPostSimulationCallback; //Find the kernels we'll dispatch later m_writePosKernel = SpringPosCompute.FindKernel("WriteInitialPos"); m_updateKernel = SpringPosCompute.FindKernel("UpdateSpring"); }
// Use this for initialization void Start() { col = new ColorHSV {A = 100.0f, H = Random.value * 360.0f, S = Random.value * 100.0f, V = Random.value * 100.0f}; syst = GetComponent<TCParticleSystem>(); syst.ParticleRenderer.Material.SetColor("_TintColor", col.ToColor()); }
private void OnSystemCreated(TCParticleSystem system) { system.RegisterCollider(this); }
// Use this for initialization void Start() { system = GetComponent<TCParticleSystem>(); startEmission = system.EmissionRate; }
void Awake() { cc = GetComponent <CharacterController>(); fireSystem = firethrower.GetComponent <TCParticleSystem>(); }
// Use this for initialization void Start() { cc = GetComponent<CharacterController>(); fireSystem = firethrower.GetComponent<TCParticleSystem>(); }
// Use this for initialization void Start() { system = GetComponent <TCParticleSystem>(); startEmission = system.EmissionRate; }