C#的类成员的定义和声明如下
using UnityEngine;
using System.Collections;
public class TestController : ECController {
int a = b();
public static int test=10;
static int g = gg();
public static TestController Instance = new TestController();
static int gg()
{
Debug.Log("~~~~~~~gg~~~~");
return 99;
}
static int d=100;
static int b()
{
Debug.Log("~~~~~~~b~~~~~~~");
test=test+2;
return test;
}
int c=9;
private TestController()
{
ControllerManager.Instance.AddListener(this);
Debug.Log("~~~TestController~test~~~~~~~"+test+" "+c+" d "+d);
test=9;
}
static TestController()
{
Debug.Log("~~~TestController~test~~~~~~~"+test+" d "+d+" f "+f);
}
static int f=100;
static void main()
{
bool flag=false;
if(flag)//if(false)
{
}
Debug.Log("~~~main~~");
TestController t = TestController.Instance;
Debug.Log("~~~~~main~2~~"+TestController.f);
}
}