示例#1
0
        public void UpdateReference()
        {
            if (this.parentLayer.TryGetTarget(out AAILayer parentLayer))
            {
                StarLinkEntity starLinkEntity = parentLayer.GetEntityFromAIEntity(this) as StarLinkEntity;

                this.StarFrom = parentLayer.GetAIEntityFromEntity(starLinkEntity.StarFrom) as AIStarEntity;
                this.StarTo   = parentLayer.GetAIEntityFromEntity(starLinkEntity.StarTo) as AIStarEntity;
            }
        }
示例#2
0
        public override IObject2D CreateObject2D(World2D world2D, ALayer2D layer2D, IObject obj)
        {
            if (obj is StarLinkEntity)
            {
                StarLinkEntity entity = obj as StarLinkEntity;

                return(new StarLinkEntity2D(layer2D, this, entity));
            }

            return(null);
        }
        public override IAIObject CreateObjectAI(AIWorld worldAI, AAILayer layerAI, IObject obj)
        {
            if (obj is StarLinkEntity)
            {
                StarLinkEntity entity = obj as StarLinkEntity;

                return(new AIStarLinkEntity(layerAI, this, entity));
            }

            return(null);
        }
示例#4
0
        protected void InitializeState(StarLinkEntity entity)
        {
            this.CurrentColorFrom = this.starEntityFrom.ObjectSprite.Color;
            this.RatioColorFrom   = 0.33f;
            this.CurrentColorTo   = this.starEntityTo.ObjectSprite.Color;
            this.RatioColorTo     = 0.33f;

            //this.FillRatio = 0;
            //this.FillRatioState = TargetedFillRatioState.STOP;
            this.IsFocused = false;

            this.isActive = entity.IsActive;

            this.StartNotActiveState();
        }
示例#5
0
        public StarLinkEntity2D(ALayer2D layer2D, IObject2DFactory factory, StarLinkEntity entity) :
            base(layer2D, factory, entity)
        {
            this.currentColorFrom = Color.Black;
            this.currentColorTo   = Color.Black;
            this.ratioColorFrom   = -1;
            this.ratioLinkTo      = -1;

            this.starEntityFrom = layer2D.GetEntity2DFromEntity(entity.StarFrom) as StarEntity2D;
            this.starEntityTo   = layer2D.GetEntity2DFromEntity(entity.StarTo) as StarEntity2D;

            //this.fillRatio = 0;
            this.isFocused = true;

            this.ObjectSprite.Color = Color.Blue;

            Shader shader = new Shader(null, null, @"Assets\Graphics\Shaders\LinkSimpleFrag.frag");

            Texture distortionMap = factory.GetTextureById("distorsionTexture");

            this.ObjectSprite.Texture          = factory.GetTextureById("distorsionTexture");
            this.ObjectSprite.Texture.Repeated = true;

            distortionMap.Repeated = true;
            distortionMap.Smooth   = true;
            shader.SetUniform("currentTexture", new Shader.CurrentTextureType());
            shader.SetUniform("distTexture", distortionMap);

            render        = new RenderStates(BlendMode.Alpha);
            render.Shader = shader;

            this.UpdateScaling();

            this.Priority = 9;

            this.InitializeState(entity);
        }
示例#6
0
 public StarLinkEntity2D(ALayer2D parentLayer, StarLinkEntity entity) :
     base(parentLayer, null, entity)
 {
 }
示例#7
0
 protected virtual bool IsStarLinkValid(StarLinkEntity link)
 {
     return(true);
 }