コード例 #1
0
        public void SetConfig(EmitterConfig config)
        {
            if (config.m_TextureFilePath == "default" || config.m_TextureFilePath == "")
                //ParticleTexture = m_ContentManager.Load<Texture2D>("whiteCircle.png");
                ParticleTexture = m_DefaultTexture;
            else
            {
                try
                {
                    ParticleTexture = m_TextureLoader.FromFile(config.m_TextureFilePath);
                }
                catch (System.Exception ex)
                {
                    ParticleTexture = m_DefaultTexture;
                    Console.WriteLine("The texture you provided could not be found!");
                }
            }

            Origin = config.m_Origin;
            EmitterDuration = config.m_EmitterDuration;
            IsInfinite = config.m_IsInfinite;
            IsOn = config.m_IsOn;
            Type = config.m_Type;
            StartColor = config.m_StartColor;
            StartColorVariance = config.m_StartColorVariance;
            EndColor = config.m_EndColor;
            EndColorVariance = config.m_EndColorVariance;
            MaxParticles = config.m_MaxParticles;
            Lifespan = config.m_Lifespan * 1000;
            StartSize = config.m_StartSize;
            StartSizeVariance = config.m_StartSizeVariance;
            EndSize = config.m_EndSize;
            EndSizeVariance = config.m_EndSizeVariance;
            EmitterAngle = config.m_EmitterAngle;
            EmitterAngleVariance = config.m_EmitterAngleVariance;
            StartRotation = config.m_StartRotation;
            StartRotationVariance = config.m_StartRotationVariance;
            EndRotation = config.m_EndRotation;
            EndRotationVariance = config.m_EndRotationVariance;
            X_Variance = config.m_XVariance;
            Y_Variance = config.m_YVariance;
            Speed = config.m_Speed;
            SpeedVariance = config.m_SpeedVariance;
            GravityX = config.m_GravityX;
            GravityY = config.m_GravityY;
            TangentialAcceleration = config.m_TangentialAcceleration;
            TangentialAccelerationVariance = config.m_TangentialAccelerationVariance;
            RadialAcceleration = config.m_RadialAcceleration;
            RadialAccelerationVariance = config.m_RadialAccelerationVariance;
            MinRadius = config.m_MinRadius;
            MaxRadius = config.m_MaxRadius;
            MaxRadiusVariance = config.m_MaxRadiusVariance;
            Degrees = config.m_Degrees;
            DegreesVariance = config.m_DegreesVariance;
            BlendType = config.m_BlendType;
            SortMode = config.m_SortMode;
        }
コード例 #2
0
        public EmitterConfig GetConfig()
        {
            EmitterConfig config = new EmitterConfig();
            config.m_TextureFilePath = m_TextureFilepath;
            config.m_Origin = m_Origin;
            config.m_EmitterDuration = m_EmitterDuration;
            config.m_IsInfinite = m_IsInfinite;
            config.m_IsOn = m_IsOn;
            config.m_Type = m_Type;
            config.m_StartColor = m_StartColor.toColor();
            config.m_StartColorVariance = m_StartColorVariance.toColor();
            config.m_EndColor = m_EndColor.toColor();
            config.m_EndColorVariance = m_EndColorVariance.toColor();
            config.m_MaxParticles = m_MaxParticles;
            config.m_Lifespan = m_Lifespan / 1000;
            config.m_StartSize = m_StartSize;
            config.m_StartSizeVariance = m_StartSizeVariance;
            config.m_EndSize = m_EndSize;
            config.m_EndSizeVariance = m_EndSizeVariance;
            config.m_EmitterAngle = m_EmitterAngle;
            config.m_EmitterAngleVariance = m_EmitterAngleVariance;
            config.m_StartRotation = m_StartRotation;
            config.m_StartRotationVariance = m_StartRotationVariance;
            config.m_EndRotation = m_EndRotation;
            config.m_EndRotationVariance = m_EndRotationVariance;
            config.m_XVariance = m_XVariance;
            config.m_YVariance = m_YVariance;
            config.m_Speed = m_Speed;
            config.m_SpeedVariance = m_SpeedVariance;
            config.m_GravityX = m_GravityX;
            config.m_GravityY = m_GravityY;
            config.m_TangentialAcceleration = m_TangentialAcceleration;
            config.m_TangentialAccelerationVariance = m_TangentialAccelerationVariance;
            config.m_RadialAcceleration = m_RadialAcceleration;
            config.m_RadialAccelerationVariance = m_RadialAccelerationVariance;
            config.m_MinRadius = m_MinRadius;
            config.m_MaxRadius = m_MaxRadius;
            config.m_MaxRadiusVariance = m_MaxRadiusVariance;
            config.m_Degrees = m_Degrees;
            config.m_DegreesVariance = m_DegreesVariance;
            config.m_BlendType = m_BlendType;
            config.m_SortMode = m_SortMode;

            return config;
        }