// Start is called before the first frame update void Start() { Health = MaxHealth; rb = GetComponent <Rigidbody2D>(); scorer = FindObjectOfType <ScorePlayers>(); OnDie.AddListener(() => scorer.EnemyKill(this)); }
void Start() { rb = GetComponent <Rigidbody2D>(); rend = GetComponent <SpriteRenderer>(); Health = MaxHealth; scorer = FindObjectOfType <ScorePlayers>(); if (ID == PlayerID.Left) { graphics = SelectorScript.instance.leftGraphics; } else if (ID == PlayerID.Right) { graphics = SelectorScript.instance.rightGraphics; } rend.sprite = graphics.FrontSprite; }