Example #1
0
        }   // end of c'tor

        /// <summary>
        /// Gets the current bone transform.
        /// </summary>
        /// <param name="pose">The pose.</param>
        /// <returns>The current transform of the bone.</returns>
        public Matrix GetCurrentBoneTransform(BonePose pose)
        {
            if (animationControllers.Count == 0)
            {
                return(pose.DefaultTransform);
            }

            Matrix transform = new Matrix();
            Matrix m;

            for (int i = 0; i < animationControllers.Count; i++)
            {
                IAnimationController ac = animationControllers[i];

                if (ac.Weight > 0.0f)
                {
                    if (ac.ContainsAnimationTrack(pose))
                    {
                        m          = ac.GetCurrentBoneTransform(pose);
                        transform += ac.Weight == 1.0f ? m : ac.Weight * m;
                    }
                    else
                    {
                        transform += ac.Weight == 1.0f ? pose.DefaultTransform : ac.Weight * pose.DefaultTransform;
                    }
                }
            }

            return(transform);
        }   // end of GetCurrentBoneTransform()
 public UniqueTransition SetAnimationController(IAnimationController animationController, Type fromViewController, TransitionAction action)
 {
     return(SetAnimationController(
                animationController,
                fromViewController == null ? null : new ObjCRuntime.Class(fromViewController),
                action));
 }
 public UniqueTransition SetAnimationController <T> (IAnimationController animationController, TransitionAction action)
     where T : UIViewController
 {
     return(SetAnimationController(
                animationController,
                new ObjCRuntime.Class(typeof(T)),
                action));
 }
 public UniqueTransition SetAnimationController <TFrom, TTo> (IAnimationController animationController, TransitionAction action)
     where TFrom : UIViewController
     where TTo : UIViewController
 {
     return(SetAnimationController(
                animationController,
                new ObjCRuntime.Class(typeof(TFrom)),
                new ObjCRuntime.Class(typeof(TTo)),
                action));
 }
 public AnimatedMeshListTreeNode(string text,
                                 List <IRenderable> meshes,
                                 MOMDocument entity,
                                 int animation,
                                 IAnimationController animationController,
                                 IEnumerable <TreeNode> children = null,
                                 Action <TreeNode> onSelect      = null,
                                 ContextMenu contextMenu         = null) : base(text, meshes, children, onSelect, contextMenu)
 {
     _animation           = animation;
     _animationController = animationController;
     _entity = entity;
 }
Example #6
0
        /// <summary>
        /// Advances the current time in the animation.
        /// </summary>
        /// <param name="ticks">Elapsed time for this frame.  1 tick = 100 nanoseconds.</param>
        public void UpdateAnim(long ticks)
        {
            for (int i = 0; i < animationControllers.Count; i++)
            {
                IAnimationController ac = animationControllers[i];

                // This skips updates on animations that have a weighting of 0.
                // This saves CPU cycles but also gets the animations out of sync.  Is this a problem?
                if (ac.Weight > 0.0f)
                {
                    ac.UpdateAnim(ticks);
                }
            }
        }   // end of UpdateAnim()
Example #7
0
 private void Awake()
 {
     animationcontroller_ = GameObject.Find("Player").GetComponent <AnimationController>();
     Attack_A_listner     = GameObject.Find("attack_A_box").GetComponent <Attack_Listner>();
     Attack_B_listner     = GameObject.Find("attack_b_box").GetComponent <Attack_Listner>();
     Attack_C_listner     = GameObject.Find("attack_c_box").GetComponent <Attack_Listner>();
     state_comboA         = new State_AttackA(this);
     state_comboB         = new State_AttackB(this);
     state_comboEnd       = new State_ComboDone(this);
     state_waitingroom    = new State_ComboReady(this);
     Collider_Attack      = GetComponent <Collider2D>();
     State          = state_waitingroom;
     _state         = StateToSet.waitroom;
     CurrentState   = _state;
     Hitinterval    = 0;
     MaxhitInterval = 1;
 }
Example #8
0
        public Game1()
        {
            _graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            _playerAnimationController = new BirdsEyeViewWalkingAnimationController(_standLeftAnimation,
                                                                        _standRightAnimation,
                                                                        _standUpAnimation,
                                                                        _standDownAnimation,
                                                                        _walkLeftAnimation,
                                                                        _walkRightAnimation,
                                                                        _walkUpAnimation,
                                                                        _walkDownAnimation);

            _character = new KeyboardControlledPlayableCharacter(_playerAnimationController);

            IsMouseVisible = true;
        }
Example #9
0
        public Game1()
        {
            _graphics             = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            _playerAnimationController = new BirdsEyeViewWalkingAnimationController(_standLeftAnimation,
                                                                                    _standRightAnimation,
                                                                                    _standUpAnimation,
                                                                                    _standDownAnimation,
                                                                                    _walkLeftAnimation,
                                                                                    _walkRightAnimation,
                                                                                    _walkUpAnimation,
                                                                                    _walkDownAnimation);

            _character = new KeyboardControlledPlayableCharacter(_playerAnimationController);

            IsMouseVisible = true;
        }
Example #10
0
        // ================================================================================
        //  unity methods
        // --------------------------------------------------------------------------------

        #region unity methods

        void Awake()
        {
            _transform           = transform;
            _rigidbody2D         = GetComponent <Rigidbody2D>();
            _collider2D          = GetComponent <Collider2D>();
            _animationController = _transform.GetInterface <IAnimationController>();
            target = new ActorTarget(this, _transform);

            if (_health == null)
            {
                health = new Energy(_maxHealth);
            }

            // set callback functions
            GetEstimatedFuturePosition = EstimateFuturePosition;
            deathExecutionHandler      = DestroyAtDeath;

            Reset();
        }
Example #11
0
 public void Awake()
 {
     Playerone            = GetComponent <PlayerOne>();
     animationcontroller_ = GetComponent <IAnimationController>();
     combocontroller      = GameObject.Find("HitBoxes").GetComponent <ComboController>();
     State_Spawning       = new State_Spawning(this);
     State_Running        = new State_Running(this);
     State_Standing       = new State_Standing(this);
     State_Hit            = new State_Hit(this);
     State_Falling        = new State_Falling(this);
     State_Landing        = new State_Landing(this);
     State_Dead           = new State_Died(this);
     State_Jumping        = new State_Jumping(this);
     State_RunJumping     = new State_RunningAndJumping(this);
     State_Attacking      = new State_Attacking(this);
     State_Jumped         = new State_Jumped(this);
     State        = State_Spawning;
     _state       = State_enum.State_Spawning;
     CurrentState = _state;
 }
Example #12
0
        // ================================================================================
        //  unity methods
        // --------------------------------------------------------------------------------

        #region unity methods

        void Awake()
        {
            _transform           = transform;
            _rigidbody2D         = rigidbody2D;
            _collider2D          = collider2D;
            _animationController = _transform.GetInterface <IAnimationController>();
            target = new Target(this, _transform);

            // set callback functions
            GetEstimatedFuturePosition = EstimateFuturePosition;
            deathExecutionHandler      = DestroyAtDeath;

            if (health > 0)
            {
                _startHealth = health;
            }
            else
            {
                _startHealth = maxHealth;
            }

            Reset();
        }
		[SetUp] public void Init()
		{ 
			animation = GetAnimationMock ();
			cAnimation = GetControllerMock (animation);	
		}
		private CharaAnimationController GetControllerMock(IAnimationController animation) {
			var cAnimation = Substitute.For<CharaAnimationController> ();
			cAnimation.SetAnimationController (animation);
			return cAnimation;
		}
Example #15
0
		// ================================================================================
		//  unity methods
		// --------------------------------------------------------------------------------

		#region unity methods

		void Awake()
		{
			_transform = transform;
			_rigidbody2D = GetComponent<Rigidbody2D>();
			_collider2D = GetComponent<Collider2D>();
			_animationController = _transform.GetInterface<IAnimationController>();
			target = new ActorTarget(this, _transform);

			if (_health == null)
				health = new Energy(_maxHealth);

			// set callback functions
			GetEstimatedFuturePosition = EstimateFuturePosition;
			deathExecutionHandler = DestroyAtDeath;

			Reset();
		}
		public void SetAnimationController(IAnimationController animationController) {
			this.animationController = animationController;
		}
Example #17
0
 public void Start()
 {
     this.animationController = GetComponent <IAnimationController>();
 }
 public KeyboardControlledPlayableCharacter(IAnimationController animationController)
 {
     _animationController = animationController;
 }
 public KeyboardControlledPlayableCharacter(IAnimationController animationController)
 {
     _animationController = animationController;
 }
Example #20
0
 public TreeController(IAnimationController animationController, GUIExportController exportController)
 {
     _animationController = animationController;
     _exportController    = exportController;
 }
 public void Setup(IAnimationController controller)
 {
     m_controller = controller;
 }
 public void SetAnimationController(IAnimationController animationController)
 {
     this.animationController = animationController;
 }