- Home /
nexpected symbol 'public' in class, struct, or interface member declaration.
Here is the script. I am for some reason getting this error error CS1519: unexpected symbol 'public' in class, struct, or interface member declaration.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Buttonoff : MonoBehaviour
{
public static int volume = volumechange.volume
public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
{
// Add event handler code here
volumechange.volume = 0;
Debug.Log( "Click" );
}
public void OnMouseDown( dfControl control, dfMouseEventArgs mouseEvent )
{
// Add event handler code here
volumechange.volume = 0;
Debug.Log( "MouseDown" );
}
public void OnMultiTouch( dfControl control, dfTouchEventArgs touchData )
{
// Add event handler code here
volumechange.volume = 0;
Debug.Log( "MultiTouch" );
}
}
Hard to tell with your question code formatting, but this line public static int volume = volumechange.volume
looks to not end with a semicolon
Please format your code. If you don't know how, watch the tutorial video on the right
Answer by Statement · Dec 21, 2013 at 08:19 PM
Line 7:
public static int volume = volumechange.volume
Should be:
public static int volume = volumechange.volume;
(But even that may cause problems if volumechange.volume isn't const)
Your answer
Follow this Question
Related Questions
How to make classes/structs public to all scripts 0 Answers
Best way to calculate sum of custom object holding numbers and returning sum as that object instance 0 Answers
Is it possible to Change mesh also multi materials by a button or a key 0 Answers
Weird error while trying to call a void from another class 1 Answer
Defining a public class in C# 1 Answer