/// <summary>
        /// Converts the domain model into an entity.
        /// </summary>
        /// <returns>The entity.</returns>
        /// <param name="animation">Animation.</param>
        internal static AnimationEntity ToEntity(this Animation animation)
        {
            AnimationEntity animationEntity = new AnimationEntity
            {
                Name            = animation.Name,
                CharacterColour = animation.CharacterColour,
                GenderModel     = animation.GenderModel,
                HasA            = animation.HasA,
                HasF            = animation.HasF,
                Number          = animation.Number
            };

            return(animationEntity);
        }
        /// <summary>
        /// Converts the entity into a domain model.
        /// </summary>
        /// <returns>The domain model.</returns>
        /// <param name="animationEntity">Animation entity.</param>
        internal static Animation ToDomainModel(this AnimationEntity animationEntity)
        {
            Animation animation = new Animation
            {
                Name            = animationEntity.Name,
                CharacterColour = animationEntity.CharacterColour,
                GenderModel     = animationEntity.GenderModel,
                HasA            = animationEntity.HasA,
                HasF            = animationEntity.HasF,
                Number          = animationEntity.Number
            };

            return(animation);
        }
예제 #3
0
    private void OnExit(GameObject obj)
    {
        AnimationEntity ani = this.GetComponent <AnimationEntity>();       //

        if (ani == null)
        {
            ani = this.gameObject.AddComponent <AnimationEntity>();
        }

        AnimationEntity.OnAnimationFinishDelegate OnAnimationFinished = delegate(AnimationEntity animationEntity)
        {
            //GameObject.Destroy(ani.gameObject);
            this.gameObject.SetActive(false);
        };

        ani.Play(exitAnimationName, OnAnimationFinished, true);
    }
예제 #4
0
 public void StartAnimation()
 {
     _selectedAnimation = animationEntities[0];
     Play(_selectedAnimation.sprites);
 }