Hi Guys I need help to figure out what thing that Occurs THIS Annoying Error :(.
So here is the Script:
using UnityEngine; using System.Collections; public class VitalBar : MonoBehaviour { private bool _isPlayerHealthBar void Start() { _isPlayerHealthBar = true; OnEnable(); } // Update is called once per frame void Update () { } public void OnEnable() { if(_isPlayerHealthBar) Messanger.AddListener("Player Health Update", OnChangeHealthBarSize); else Messanger.AddListener("No Health Update", OnChangeHealthBarSize); } public void OnDisable() { if(_isPlayerHealthBar) Messanger.AddListener("Player Health Update", OnChangeHealthBarSize); else Messanger.AddListener("No Health Update", OnChangeHealthBarSize); } public void ChangeHealthBarSize(int currHealth, int maxHealth) { Debug.Log("We heard an event: currHealth = " + currHealth + " - maxHealth = " + maxHealth); } public void SetPlayerHealth(bool b) { _isPlayerHealthBar = b; } }
Any ideas xD?
EDIT: FIXED xD