Exemple #1
0
 protected virtual void SetAnimation(SpriteAnimation animation)
 {
     _animation            = animation;
     _directionalAnimation = animation as DirectionalAnimation;
     if (_directionalAnimation != null)
     {
         _billboard = Graph.Entity.Get <SpriteBillboardComponent>();
     }
     SetupAnimation();
 }
        private void UpdateBillboard(SpriteBillboardComponent billboard, Transform baseTr, Transform spriteTr, bool backwards)
        {
            billboard.Billboard.Apply(spriteTr, backwards, ref billboard.LastAngleHeight);
            var orientation = SpriteFacingControl.GetCameraSide(billboard.Facing, spriteTr, baseTr, 5, out var inMargin);

            if (!inMargin || !(orientation.IsAdjacent(billboard.Orientation)))
            {
                billboard.Orientation = orientation;
            }
        }
 public DirectionalRuntimeAnimationNode(SpriteAnimationNode node, RuntimeStateGraph graph) : base
         (node, graph)
 {
     _billboard = graph.Entity.Get <SpriteBillboardComponent>();
 }