Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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();
		}