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

        isNeedShowAction = true;
        isNeedShowLeave  = true;

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