示例#1
0
        public static ClientComponentSpriteLightSource CreateLightSourceSpot(
            IClientSceneObject sceneObject,
            Color color,
            Size2F size,
            Size2F?logicalSize        = null,
            Vector2D?spritePivotPoint = null,
            Vector2D?positionOffset   = null)
        {
            var result = sceneObject.AddComponent <ClientComponentSpriteLightSource>();

            result.Color         = color;
            result.RenderingSize = size;
            result.LogicalSize   = logicalSize ?? size;

            if (spritePivotPoint.HasValue)
            {
                result.SpritePivotPoint = spritePivotPoint.Value;
            }

            if (positionOffset.HasValue)
            {
                result.PositionOffset = positionOffset.Value;
            }

            return(result);
        }
示例#2
0
 public static void Setup(
     IClientSceneObject sceneObject,
     double duration,
     DelegateUpdateCallback updateCallback)
 {
     sceneObject.AddComponent <ClientComponentGenericAnimationHelper>()
     .SetupInternal(duration, updateCallback);
 }
示例#3
0
        protected override BaseClientComponentLightSource ClientCreateLightSource(IClientSceneObject sceneObject)
        {
            var lightSource = base.ClientCreateLightSource(sceneObject);

            // add light flickering
            sceneObject.AddComponent <ClientComponentLightSourceEffectFlickering>()
            .Setup(lightSource,
                   flickeringPercents: 5,
                   flickeringChangePercentsPerSecond: 33);

            return(lightSource);
        }
示例#4
0
        protected override BaseClientComponentLightSource ClientCreateLightSource(
            IItem item,
            ICharacter character,
            IClientSceneObject sceneObject)
        {
            var lightSource = base.ClientCreateLightSource(item, character, sceneObject);

            // add light flickering
            sceneObject.AddComponent <ClientComponentLightSourceEffectFlickering>()
            .Setup(lightSource,
                   flickeringPercents: 10,
                   flickeringChangePercentsPerSecond: 70);

            return(lightSource);
        }