コード例 #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());
    }
コード例 #2
0
    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();
    }
コード例 #3
0
        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();
        }
コード例 #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");
    }
コード例 #5
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());
    }
コード例 #6
0
ファイル: TCCollider.cs プロジェクト: hon454/Luci_Unite2017
 private void OnSystemCreated(TCParticleSystem system)
 {
     system.RegisterCollider(this);
 }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     system = GetComponent<TCParticleSystem>();
     startEmission = system.EmissionRate;
 }
コード例 #8
0
 void Awake()
 {
     cc         = GetComponent <CharacterController>();
     fireSystem = firethrower.GetComponent <TCParticleSystem>();
 }
コード例 #9
0
 // Use this for initialization
 void Start()
 {
     cc  = GetComponent<CharacterController>();
     fireSystem = firethrower.GetComponent<TCParticleSystem>();
 }
コード例 #10
0
 // Use this for initialization
 void Start()
 {
     system        = GetComponent <TCParticleSystem>();
     startEmission = system.EmissionRate;
 }