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