Simplify OnParticipantSpriteClicked setup
This commit is contained in:
parent
d8af43db53
commit
ee8d66610e
2 changed files with 9 additions and 9 deletions
|
|
@ -4,13 +4,15 @@ using UnityEngine;
|
|||
|
||||
public class BattleParticipantSprite : MonoBehaviour
|
||||
{
|
||||
public delegate void SpriteClickedAction();
|
||||
public delegate void SpriteClickedAction(BattleParticipant participant);
|
||||
public event SpriteClickedAction OnSpriteClicked;
|
||||
|
||||
private BattlePlayerControls playerControls;
|
||||
private BattleParticipant participant;
|
||||
|
||||
public void Init(BattlePlayerControls playerControls) {
|
||||
public void Init(BattlePlayerControls playerControls, BattleParticipant participant) {
|
||||
this.playerControls = playerControls;
|
||||
this.participant = participant;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
|
|
@ -27,7 +29,7 @@ public class BattleParticipantSprite : MonoBehaviour
|
|||
|
||||
void OnMouseDown() {
|
||||
Debug.Log("Clicked " + this.name);
|
||||
OnSpriteClicked();
|
||||
OnSpriteClicked(participant);
|
||||
}
|
||||
|
||||
private Color savedColor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue