using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class AxeDestroy : MonoBehaviour
{
public GameObject Axe;
void OnMouseDown ()
{
if (GameObject.Find("Axe").GetComponent<AxeObtained>() == true)
{
Debug.Log ("Axe is ready");
Destroy (gameObject);
}
if (!GameObject.Find("Axe").GetComponent<AxeObtained>() == false)
{
Debug.Log ("Axe is unequipped");
}
}
CS8025 is a parsing error. Usually means a bracket is missing. Add a “}” to the end. Notice how the function is missing one.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class AxeDestroy : MonoBehaviour {
public GameObject Axe;
void OnMouseDown ()
{
if (GameObject.Find("Axe").GetComponent<AxeObtained>() == true)
{
Debug.Log ("Axe is ready");
Destroy (gameObject);
}
if (!GameObject.Find("Axe").GetComponent<AxeObtained>() == false)
{
Debug.Log ("Axe is unequipped");
}
}
}