Ejemplo n.º 1
0
        public override VFXExpressionMapper GetExpressionMapper(VFXDeviceTarget target)
        {
            var  particleData     = GetData() as VFXDataParticle;
            bool isRecordedBounds = particleData && particleData.boundsSettingMode == BoundsSettingMode.Recorded;

            // GPU
            if (target == VFXDeviceTarget.GPU)
            {
                var gpuMapper = VFXExpressionMapper.FromBlocks(activeFlattenedChildrenWithImplicit);
                if (ownedType == VFXDataType.ParticleStrip && !hasGPUSpawner)
                {
                    gpuMapper.AddExpressionsFromSlot(inputSlots[(isRecordedBounds ? 2 : 1)], -1); // strip index
                }
                return(gpuMapper);
            }

            // CPU
            var cpuMapper = new VFXExpressionMapper();

            if (particleData)
            {
                switch (particleData.boundsSettingMode)
                {
                case BoundsSettingMode.Manual:
                    cpuMapper.AddExpressionsFromSlot(inputSlots[0], -1);     // bounds
                    break;

                case BoundsSettingMode.Recorded:
                    cpuMapper.AddExpressionsFromSlot(inputSlots[0], -1);     // bounds
                    cpuMapper.AddExpressionsFromSlot(inputSlots[1], -1);     //bounds padding
                    break;

                case BoundsSettingMode.Automatic:
                    cpuMapper.AddExpressionsFromSlot(inputSlots[0], -1);     //bounds padding
                    break;
                }
            }

            return(cpuMapper);
        }
        public override VFXExpressionMapper GetExpressionMapper(VFXDeviceTarget target)
        {
            // GPU
            if (target == VFXDeviceTarget.GPU)
            {
                var gpuMapper = VFXExpressionMapper.FromBlocks(activeFlattenedChildrenWithImplicit);
                if (ownedType == VFXDataType.ParticleStrip)
                {
                    gpuMapper.AddExpressionsFromSlot(inputSlots[1], -1); // strip index
                }
                return(gpuMapper);
            }

            // CPU
            var cpuMapper = new VFXExpressionMapper();

            cpuMapper.AddExpressionsFromSlot(inputSlots[0], -1); // bounds
            return(cpuMapper);
        }