Esempio n. 1
0
        // ================================================================================
        //  unity methods
        // --------------------------------------------------------------------------------

        void Awake()
        {
            _transform = transform;

            _self = _transform.GetInterface<IActor>();
            if (_self == null && _transform.parent != null)
                _self = _transform.parent.GetInterface<IActor>();
        }
Esempio 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();
		}