Beispiel #1
0
    void Start()
    {
        KeysMan.AddKeyEvent(KeyCode.Escape, Application.Quit);
        KeysMan.AddKeyEvent(KeyCode.F1, ToggleShowInfo);
        KeysMan.AddKeyEvent(KeyCode.F2, ToggleGravity);
        KeysMan.AddKeyEvent(KeyCode.F3, ToggleCrawl);
        KeysMan.AddKeyEvent(KeyCode.F4, ToggleNeuron);
        KeysMan.AddKeyEvent(KeyCode.Mouse0, checkCollision);

        UIMan.Inst.SetText(0, null, "Show/Hide Infomation (F1)");

        Init();
    }
Beispiel #2
0
    void Start()
    {
        // notice: camera control keys, please see the CameraCtrl.cs:Update

        KeysMan.AddKeyEvent(KeyCode.Escape, Application.Quit);
        KeysMan.AddKeyEvent(KeyCode.F, ToggleNeuronActive);
        KeysMan.AddKeyEvent(KeyCode.F1, ToggleShowInfo);
        KeysMan.AddKeyEvent(KeyCode.F2, ToggleGravity);
        KeysMan.AddKeyEvent(KeyCode.F3, ToggleMuscle);
        KeysMan.AddKeyEvent(KeyCode.F4, ToggleNeuron);
        KeysMan.AddKeyEvent(KeyCode.Mouse0, checkCollision);        // use to select neurons.

        UIMan.Inst.SetText(0, null, "Show/Hide Infomation (F1)");

        Init();
    }
Beispiel #3
0
    void Update()
    {
        if (Time.time > lastSecond + 0.1f)
        {
            UIMan.Inst.SetText(1, "Gravity (F2):", Globals.mode2);
            UIMan.Inst.SetText(2, "Crawling (F3):", Globals.mode3);
            UIMan.Inst.SetText(3, "Neuron (F4):", Globals.mode4);
            lastSecond = Time.time;
        }

        KeysMan.update();
        if (Globals.status == EAppStatus.running || Globals.status == EAppStatus.pause)
        {
            UpdateLogic();
            Draw();
        }
    }
Beispiel #4
0
    void Update()
    {
        if (Time.time > lastSecond + 0.1f)
        {
            UIMan.Inst.SetText(1, "Apply Gravity (F2):", Globals.applyGravity);
            UIMan.Inst.SetText(2, "Muscle Simulate (F3):", Globals.muscleSimulate);
            UIMan.Inst.SetText(3, "Neuron Simulate (F4):", Globals.neuronSimulate);
            UIMan.Inst.SetText(3, "Active Neurons (F):", Globals.neuron_active);
            lastSecond = Time.time;
        }

        KeysMan.update();
        if (Globals.status == EAppStatus.running || Globals.status == EAppStatus.pause)
        {
            UpdateLogic();
            Draw();
        }
        //  Send();
    }
Beispiel #5
0
    void Update()
    {
        if (Time.time > lastSecond + 0.1f)
        {
            UIMan.Inst.SetText(1, "Apply Gravity (F2):", Globals.applyGravity);
            UIMan.Inst.SetText(2, "Muscle Simulate (F3):", Globals.muscleSimulate);
            UIMan.Inst.SetText(3, "Neuron Simulate (F4):", Globals.neuronSimulate);
            UIMan.Inst.SetText(4, "Active Neurons (F):", Globals.neuron_active);
            lastSecond = Time.time;
        }

        KeysMan.update();
        if (Globals.status == EAppStatus.running || Globals.status == EAppStatus.pause)
        {
            UpdateLogic();
            Draw();
        }
        UIMan.Inst.SetText(0, "Step:", TotalStep);
        if (TotalStep % 100 == 0 && TotalStep != 0)
        {
            ScreenShot.Inst.Capture();
        }
    }