public void ControllerTest() { //Init SystemController.GetInstance().ChangeRefreshStrategy(new ManualRefresh()); Counter.GetInstance().ChangeMathModel(new LogisticModel()); Species fox = new Species("fox", 10, 3, 1, 200); Ecosystem.GetInstance().AddSpecies(fox); SystemController.GetInstance().ExecuteRefresh(); SystemController.GetInstance().StopRefresh(); Assert.AreEqual(29, fox.Population); Species rabbit = new Species("rabbit", 30, 3, 1, 500); Ecosystem.GetInstance().AddSpecies(rabbit); rabbit.Relations[0] = -1; Counter.GetInstance().ChangeMathModel(new N_SpaciesModel_General()); SystemController.GetInstance().ExecuteRefresh(); Assert.AreEqual(87, fox.Population); Assert.AreEqual(0, rabbit.Population); Ecosystem.GetInstance().Species.Clear(); History.GetInstance().Data.Clear(); }
void Awake() { mainText.text = "欢迎 " + SystemController.GetInstance().getMainPlayer().name + " 开始冒险"; isNeedShowAction = true; isNeedShowLeave = true; currentToggle = new List <GameObject>(); }
public bool Judge() { //根据requirement的类型进行判断 switch (requirement) { case "leader": //WorkManager.instance.addText("结合你相关技能成功率为" + (SystemController.GetInstance().getMainPlayer().skill.leader - requirementValue) + "%"); return(rpgJudge(SystemController.GetInstance().getMainPlayer().skill.leader - requirementValue)); break; case "fight": return(rpgJudge(SystemController.GetInstance().getMainPlayer().skill.fight - requirementValue)); break; case "dex": return(rpgJudge(SystemController.GetInstance().getMainPlayer().skill.dex - requirementValue)); break; case "unlock": return(rpgJudge(SystemController.GetInstance().getMainPlayer().skill.unlock - requirementValue)); break; case "knowledge": return(rpgJudge(SystemController.GetInstance().getMainPlayer().skill.knowledge - requirementValue)); break; default: return(false); break; } }
internal void Awake() { SystemController.GetInstance().init(); }
// Update is called once per frame void Update() { //Debug.Log("Reset"); SystemController.GetInstance().Update(); }
// Start is called before the first frame update void Start() { Debug.Log("Start"); SystemController.GetInstance().Start(); }
/// <summary> /// 禁用时 /// </summary> private void OnDisable() { Debug.Log("OnDisable"); SystemController.GetInstance().OnDisable(); }
/// <summary> /// 销毁调用 /// </summary> private void OnDestroy() { Debug.Log("OnDestroy"); SystemController.GetInstance().Destory(); }
/// <summary> /// 绘制时调用 /// </summary> private void OnGUI() { //Debug.Log("OnGUI"); SystemController.GetInstance().OnGUI(); }
/// <summary> /// update执行之后,必定执行该方法 /// </summary> private void LateUpdate() { //Debug.Log("LateUpdate"); SystemController.GetInstance().LateUpdate(); }
/// <summary> /// 每帧都回刷新 /// </summary> private void FixedUpdate() { //Debug.Log("FixedUpdate"); SystemController.GetInstance().FixedUpdate(); }
/// <summary> /// 在start方法调用前调用一次 /// </summary> private void Awake() { Debug.Log("Awake"); SystemController.GetInstance().Awake(); }