Пример #1
0
        public Character(Sprite sprite, SpineAnimation animation)
            : this()
        {
            this.animation = animation;

            this.sprite      = sprite;
            this.layerSprite = (Sprite)this.sprite.Clone();

            this.ResetColorEffect();
        }
Пример #2
0
        public Character(Sprite sprite, SpineAnimation animation, int hp, int move, Rank rank, Army army = Army.Normal, Special special = Special.None)
            : this(sprite, animation)
        {
            this.hp   = hp;
            this.move = move;

            this.special = special;
            this.weapon  = special == Special.None ? Weapon.Sword : Weapon.None;

            this.rank = rank;
            this.army = army;

            this.rankLevel = hp + move;
            this.maxHP     = hp;
        }
Пример #3
0
        public object Clone()
        {
            SpineAnimation clone = (SpineAnimation)this.MemberwiseClone();

            SkeletonData skeletonData;

            SkeletonJson json = new SkeletonJson(atlas);

            skeletonData = json.ReadSkeletonData(this.filesName + ".json");

            this.skeleton = new Skeleton(skeletonData);

            clone.skeleton = new Skeleton(skeletonData);

            AnimationStateData animationStateData = new AnimationStateData(skeleton.Data);

            clone.animationState = new AnimationState(animationStateData);
            clone.animationState.SetAnimation(0, this.animationName, true);

            clone.Position = Vector2.Zero;
            clone.skeleton.UpdateWorldTransform();

            return(clone);
        }