question about Default Reference by using c# in Unity

I am new to Unity,I know that if I declare a variety in js script,the Unity_Default_Reference_window will show my variety,so that I can edit my variety directly.
And now I am learning c#, also I declared a variety in the script.yet I cant see anything to edit…
I wander why…

for Example,in js:
when I wrote
var speed = 5.0;//the DefaultReference Window would show me a editable variety.

but in c#
I wrote
public float speed = 5.0f;//the DefaultReferenceWindow shows nothing…

sorry about my poor English,but I really need your help ,thank you very much…

Unsure but what happens when you change your JS to

var speed : float = 5.0f;

As you write it in c# it should show up,

Do you get any error on this script ? Because it can be one reason , where did you declare it also ?
Will be better to post your code or portion of it if too long, will be maybe easier for people to check what is wrong.

Did you declare the variable outside the class in the script ? Etc…

Should definitly work as you typed it in c#, at last copy paste a c# code sample from unity doc and see if you can see variable in inspector, just to make sure it come from your script or unity get mad on you :wink:

thank you above.
anyway , I’ll post my code here,really cant figure out why the variety not showing up…

here’s my code:

using UnityEngine;
using System.Collections;

public class PlayerMove : MonoBehaviour {

float speed = 5.0f;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
float x = Input.GetAxis(“Horizontal”)Time.deltaTimespeed;
float z = Input.GetAxis(“Vertical”)Time.deltaTimespeed;

transform.Translate(x,0,z);
}
}

thank you very much…

Finally…
the variable shows!!!

I’m not sure why it didnt show up before ,I’ll try to figure it out…

anyway thanks to all of you above~~

In the given code you do not explicitly declare the float to be public and therefor it defaults to private.