Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Error CS1519

$
0
0
I'm getting the error message: Assets/Scripts/ButtonExecute.cs(10,25): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration. I've seen other posts where people got this from missing a semicolon, but I can't seem to find any spot like that. Here's the code: using UnityEngine; using UnityEngine.EventSystems; using System.Collections; public class ButtonExecute : MonoBehaviour { public float timeToSelect = 2.0f; private float countDown; private GameObject currentButton; private clicker = new Clicker (); void Update () { Transform camera = Camera.main.transform; Ray ray = new Ray (camera.position, camera.rotation * Vector3.forward); RaycastHit hit; GameObject hitButton = null; PointerEventData data = new PointerEventData (EventSystem.current); if (Physics.Raycast (ray, out hit)) { if (hit.transform.gameObject.tag == "Button") { hitButton = hit.transform.parent.gameObject; } } if (currentButton != hitButton) { if (currentButton != null) { ExecuteEvents.Execute (currentButton, data, ExecuteEvents.pointerExitHandler); } currentButton = hitButton; if (currentButton != null) { ExecuteEvents.Execute (currentButton, data, ExecuteEvents.pointerEnterHandler); countDown = timeToSelect; } } if (currentButton != null) { countDown -= Time.deltaTime; if (clicker.clicked () || countDown < 0.0f) { ExecuteEvents.Execute (currentButton, data, ExecuteEvents.pointerClickHandler); countDown = timeToSelect; } } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>