Ejemplo n.º 1
0
 private void Awake()
 {
     if (_material == null)
     {
         var renderer = GetComponent <Renderer>();
         if (renderer != null)
         {
             _material = renderer.material;
         }
     }
     if (_manager == null)
     {
         _manager = ForceMapManager.Instance;
     }
     _prevMode = _mode;
 }
Ejemplo n.º 2
0
    private void Awake()
    {
        _forceMap        = ForceMapManager.Instance;
        _forceMap.update = false;

        _idInputTex          = Shader.PropertyToID("_InputTex");
        _idPrevTex           = Shader.PropertyToID("_PrevTex");
        _idVolumeTex         = Shader.PropertyToID("_VolumeTex");
        _idVolumeTex_Size    = Shader.PropertyToID("_VolumeTex_Size");
        _idVolumeTex_InvSize = Shader.PropertyToID("_VolumeTex_InvSize");
        _idZOffset           = Shader.PropertyToID("_ZOffset");
        _idZLerp             = Shader.PropertyToID("_ZLerp");

        _kernelInit      = _volumeShader.FindKernel("Init");
        _kernelCopyLayer = _volumeShader.FindKernel("CopyLayer");

        _propertyBlock = new MaterialPropertyBlock();
    }
Ejemplo n.º 3
0
    private void Awake()
    {
        _forceMap        = ForceMapManager.Instance;
        _forceMap.update = false;

        _idPositionBuffer = Shader.PropertyToID("_PositionBuffer");
        _idRWVelocityTex  = Shader.PropertyToID("_RWVelocityTex");
        _idVelocityTex    = Shader.PropertyToID("_VelocityTex");
        _idInputTex       = Shader.PropertyToID("_InputTex");

        _idMaxParticles = Shader.PropertyToID("_MaxParticles");
        _idLifeParams   = Shader.PropertyToID("_LifeParams");
        _idResolution   = Shader.PropertyToID("_Resolution");
        _idBounds       = Shader.PropertyToID("_Bounds");
        _idSpeed        = Shader.PropertyToID("_Speed");
        _idConfig       = Shader.PropertyToID("_Config");

        _kernelInitParticle    = _particleKernel.FindKernel("InitParticle");
        _kernelUpdateParticle  = _particleKernel.FindKernel("UpdateParticle");
        _kernelComputeVelocity = _particleKernel.FindKernel("ComputeVelocity");
    }