Add CrashingPunch and making it work

This commit is contained in:
henriquenakashima 2020-09-18 23:33:57 -04:00
parent 1c3056778e
commit d7c19e2572
15 changed files with 204 additions and 27 deletions

View file

@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BattleParticipantSprite : MonoBehaviour
{
public delegate void SpriteClickedAction();
public event SpriteClickedAction OnSpriteClicked;
// Start is called before the first frame update
void Start() {
gameObject.AddComponent<BoxCollider2D>();
}
// Update is called once per frame
void Update() {
}
void OnMouseDown() {
Debug.Log("Clicked " + this.name);
OnSpriteClicked();
}
private Color savedColor;
void OnMouseEnter() {
SpriteRenderer sprite = GetComponent<SpriteRenderer>();
this.savedColor = sprite.color;
sprite.color = Color.Lerp(this.savedColor, Color.white, .5f);
}
void OnMouseExit() {
SpriteRenderer sprite = GetComponent<SpriteRenderer>();
sprite.color = this.savedColor;
}
}