void OnEnable() { Collider2D = GetComponent <CircleCollider2D>(); Rigidbody2D = GetComponent <Rigidbody2D>(); _parent = (GameObjects.InteractingObjects.Player.Player)GetComponentInParent(typeof(GameObjects.InteractingObjects.Player.Player)); AudioSource = GetComponent <AudioSource>(); Physics2D.IgnoreCollision(Collider2D, _parent.BoxCollider2D); }
protected void Awake() { HeadRigidbody2D = GetComponent <Rigidbody2D>(); SpriteRenderer = GetComponent <SpriteRenderer>(); AudioSource = GetComponent <AudioSource>(); Parent = transform.parent.GetComponent <GameObjects.InteractingObjects.Player.Player>(); base.Awake("Textures/Player/PlayerHead/"); }
public PlayerHitpoints(GameObjects.InteractingObjects.Player.Player player) { _player = player; }