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();
        }
示例#2
0
    void Awake()
    {
        mainText.text = "欢迎 " + SystemController.GetInstance().getMainPlayer().name + " 开始冒险";

        isNeedShowAction = true;
        isNeedShowLeave  = true;

        currentToggle = new List <GameObject>();
    }
示例#3
0
    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;
        }
    }
示例#4
0
 internal void Awake()
 {
     SystemController.GetInstance().init();
 }
示例#5
0
 // Update is called once per frame
 void Update()
 {
     //Debug.Log("Reset");
     SystemController.GetInstance().Update();
 }
示例#6
0
 // Start is called before the first frame update
 void Start()
 {
     Debug.Log("Start");
     SystemController.GetInstance().Start();
 }
示例#7
0
 /// <summary>
 /// 禁用时
 /// </summary>
 private void OnDisable()
 {
     Debug.Log("OnDisable");
     SystemController.GetInstance().OnDisable();
 }
示例#8
0
 /// <summary>
 /// 销毁调用
 /// </summary>
 private void OnDestroy()
 {
     Debug.Log("OnDestroy");
     SystemController.GetInstance().Destory();
 }
示例#9
0
 /// <summary>
 /// 绘制时调用
 /// </summary>
 private void OnGUI()
 {
     //Debug.Log("OnGUI");
     SystemController.GetInstance().OnGUI();
 }
示例#10
0
 /// <summary>
 /// update执行之后,必定执行该方法
 /// </summary>
 private void LateUpdate()
 {
     //Debug.Log("LateUpdate");
     SystemController.GetInstance().LateUpdate();
 }
示例#11
0
 /// <summary>
 /// 每帧都回刷新
 /// </summary>
 private void FixedUpdate()
 {
     //Debug.Log("FixedUpdate");
     SystemController.GetInstance().FixedUpdate();
 }
示例#12
0
 /// <summary>
 /// 在start方法调用前调用一次
 /// </summary>
 private void Awake()
 {
     Debug.Log("Awake");
     SystemController.GetInstance().Awake();
 }