Exemple #1
0
            internal static DecalRenderInstance Create([NotNull] IWetDecal decal, [NotNull] WetDecalSystem system)
            {
                var registration = Pool.Get();

                registration._system = system;
                registration.Initialize(decal);

                return(registration);
            }
Exemple #2
0
        public WetDecalRenderer([NotNull] Camera camera)
        {
            Log.AssertAndThrowPossibleBug((bool)camera, "178CD4B2-1FD8-4BF2-B14D-EC9CA50436CA", "camera is null");

            _camera            = camera;
            _system            = new WetDecalSystem();
            _batches           = new List <DecalBatch>();
            _registeredBatches = new Dictionary <WetDecalSystem.MaterialBatch, DecalBatch>();

            _box           = Primitives.CreateBox(1, 1, 1);
            _box.hideFlags = HideFlags.DontSave;
        }
Exemple #3
0
        protected virtual void OnEnable()
        {
            if (_decalSystem == null)
            {
                _decalSystem = new WetDecalSystem();
            }

            _templates          = GetComponents <ParticleWetSplatterTemplate>();
            _templatesWeightSum = 0;
            for (var i = 0; i < _templates.Length; i++)
            {
                _templatesWeightSum += _templates[i].Probability;
            }
        }
Exemple #4
0
        protected virtual void OnEnable()
        {
            Log.Trace("OnEnable");

            _settings.Init();
            _settings.Changed += OnSettingsChanged;

            if (_system == null)
            {
                _system = new WetDecalSystem();
            }
            _render = _system.Add(this);

            RequireUpdate(UpdateType.Rebuild, true);
        }