void Awake() { _motor = GetComponent<entity_motor>(); _anim = transform.GetChild(0).GetComponent<entity_anim>(); _hostiles = new List<Transform>(); // if (transform.childCount > 1) // _collider = transform.GetChild(1).GetComponent<CircleCollider2D>(); }
protected virtual void Awake() { // ??? post initialize if (_host) { _data = _host.GetComponent <entity_data>(); _motor = _host.GetComponent <entity_motor>(); _anim = _host.GetChild(0).GetComponent <entity_anim>(); } _timerPath = 0f; // else // { // // * testing // _host = transform; // _data = _host.GetComponent<entity_data>(); // _motor = _host.GetComponent<entity_motor>(); // } }
void Awake() { _data = GetComponent <entity_data>(); _anim = transform.GetChild(0).GetComponent <entity_anim>(); _rb = GetComponent <Rigidbody2D>(); // _path = null; _targetIndex = 0; _spawn = Position; _move = _spawn; // _cache = Vector2.zero; // _modifiersDrag = new List<float>(); // _modifiersSpeed = new List<float>(); _modifierDrag = 1f; _modifierSpeed = 1f; _active = new List <Vector2>(); // _direction = Vector2.zero; // _anchor = Instantiate(new GameObject(), transform.position + _offset, transform.rotation); }