Ejemplo n.º 1
0
    // 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();
        }
Ejemplo n.º 4
0
    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());
    }
Ejemplo n.º 6
0
 private void OnSystemCreated(TCParticleSystem system)
 {
     system.RegisterCollider(this);
 }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     system = GetComponent<TCParticleSystem>();
     startEmission = system.EmissionRate;
 }
Ejemplo n.º 8
0
 void Awake()
 {
     cc         = GetComponent <CharacterController>();
     fireSystem = firethrower.GetComponent <TCParticleSystem>();
 }
Ejemplo n.º 9
0
 // Use this for initialization
 void Start()
 {
     cc  = GetComponent<CharacterController>();
     fireSystem = firethrower.GetComponent<TCParticleSystem>();
 }
Ejemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     system        = GetComponent <TCParticleSystem>();
     startEmission = system.EmissionRate;
 }