using Assets.Scripts.Player;
using Assets.Scripts.UI.Placeholder;
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class EventAvatar : MonoBehaviour {
    private EventUI _eventUi;
    private Mob _mob;

    public void OnMouseEnter () {
        if (_mob != null && _mob.IsAlive()) {
            _eventUi.ShowDetails(_mob, transform.position.x);
        }
    }

    public void OnMouseExit() {
        _eventUi.HideDetails(_mob);
    }

    public void SetCharacter(EventUI eventUi, Mob mob) {
        _eventUi = eventUi;
        _mob = mob;
    }

    protected void Update() {
        if (_mob != null) {
            if (_mob.IsDead()) {
                GetComponent<Image>().color = new Color(0.5f, 0.5f, 0.5f, 0.7f);
            }
        }
    }
}
