统一:创建新类实例时为NULL
Rule rule2 = new Rule(); // initiate the class Debug.Log(rule2); //1st debug rule2.RuleSetup(r: "CaughtEnough", li: 0); //setting up the parameters Debug.Log(rule2.rule); //2nd debug
null UnityEngine.Debug:Log(Object)
CaughtEnough UnityEngine.Debug:Log(Object)
Invoke(rule, 0f);
CaughtEnough();
public class Rule : MonoBehaviour {
public string rule;
public int leftInt;
public Dictionary<string, int> leftDict;
public float countdown;
public int outcome;
public CatchManager catchMan;
public Net net;
// Use this for initialization
void Start () {
RuleSetup();
}
public void RuleSetup(string r = "NoRule", int li = 0, Dictionary<string, int> ld = null, float cd = float.PositiveInfinity) {
rule = r;
leftInt = li;
leftDict = ld;
countdown = cd;
}
.....
慕沐林林
慕妹3146593
相关分类