I have this script:
using UnityEngine;
using System.Collections;
public class Menu_Options : MonoBehaviour
{
//Vars
public Material GUI_N;
public Material GUI_O;
public static bool Active = false;
public Transform Menu;
public GameObject Cam;
//Functions
void OnMouseEnter()
{
renderer.material = GUI_O;
Active = true;
}
void OnMouseExit()
{
renderer.material = GUI_N;
Active = false;
}
void Update()
{
if(Active)
{
if(Input.GetMouseButtonUp(0))
{
Options();
Debug.Log("Options");
}
}
}
void Options()
{
var s = Cam.GetComponent<SmoothCam>();
s.Instance._SetTarget(Menu);
}
}
But i get this error:
Assets/Scripts/Menu_Options.cs(37,19): error CS0176: Static member `SmoothCam.Instance' cannot be accessed with an instance reference, qualify it with a type name instead
This is how the other script is set up:
using UnityEngine;
using System.Collections;
public class SmoothCam : MonoBehaviour {
public static SmoothCam Instance;
void Awake()
{
Instance = this;
}
public void _SetTarget(Transform t)
{
target = t;
}
---The rest is not important---
What does “qualify it with a type name” mean, and how can i fix or work around this?