Esempio n. 1
0
//	public ViveWandControl V1;
//	public ViveWandControl V2;

    void Start()
    {
        //		Application.targetFrameRate = 30;

        keyCodes = new KeyCode[] {
            KeyCode.Alpha0,
            KeyCode.Alpha1,
            KeyCode.Alpha2,
            KeyCode.Alpha3,
            KeyCode.Alpha4,
            KeyCode.Alpha5,
            KeyCode.Alpha6,
            KeyCode.Alpha7,
            KeyCode.Alpha8,
            KeyCode.Alpha9
        };
        presets = new string[8];
        d       = Dials.Instance;
        d.mult  = mult;
        Application.targetFrameRate = 60;
        initInit = initial.transform.position;
        nob      = new float[100];
        nob2     = new float[100];
        switch3DObject(0);

        //for (int i = 0; i < 8; i++) {
        //presets [i] = (System.IO.File.ReadAllText ("Assets/athon/data/data_" + i + ".txt"));
//			print (presets [i]);
//			d.readDials (System.IO.File.ReadAllText ("Assets/athon/data/data_" + i + ".txt"));
        //}
        d.checkDials(true);
        d.readDials("0,1.340679,0.629921,0,8.897638,5.538507,0,9.479017,0,0,0,0,0,10,0,0,2.519684,0,0,0,0,0,0,0,0,0,0,,2.362213,0,0,0,0,0,0,0,0,0.5633354,6.284904,0,0.5511856,0,0,0,0,0,0,0,0,0,0,0,0,0,0,");
        d.knobs [1, 0] = 0;
    }
Esempio n. 2
0
    void Start()
    {
//		Application.targetFrameRate = 30;

        keyCodes = new KeyCode[] {
            KeyCode.Alpha0,
            KeyCode.Alpha1,
            KeyCode.Alpha2,
            KeyCode.Alpha3,
            KeyCode.Alpha4,
            KeyCode.Alpha5,
            KeyCode.Alpha6,
            KeyCode.Alpha7,
            KeyCode.Alpha8,
            KeyCode.Alpha9
        };
        presets = new string[8];
        d       = Dials.Instance;
        d.mult  = mult;
        Application.targetFrameRate = 60;
        initInit = initial.transform.position;
        nob      = new float[100];
        nob2     = new float[100];
        switch3DObject(0);

        for (int i = 0; i < 8; i++)
        {
            presets [i] = (System.IO.File.ReadAllText("Assets/athon/data/data_" + i + ".txt"));
            print(presets [i]);
//			d.readDials (System.IO.File.ReadAllText ("Assets/athon/data/data_" + i + ".txt"));
        }
        d.checkDials(true);
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        d = Dials.Instance;
        d.checkDials(true);
        buttons = new Button[9 * 2];
        sliders = new Slider[9 * 2 * 2];
        int   j = 0;
        int   k = 0;
        float q = 0;

        for (int i = 0; i < 9 * 2 * 2; i++)
        {
            if (i % 9 == 0)
            {
                q += spacing;
            }

            sliders[i] = Instantiate(slider);
            sliders[i].transform.parent        = slider.transform.parent;
            sliders[i].transform.localPosition = slider.transform.localPosition;
            sliders[i].transform.Translate(new Vector3(j * spacing + q, k * 100, 0));
            sliders[i].maxValue = i + 1;

            if (i < 18)
            {
                buttons [i] = Instantiate(button);
                buttons [i].transform.parent       = button.transform.parent;
                buttons[i].transform.localPosition = button.transform.localPosition;
                buttons[i].transform.Translate(new Vector3(j * spacing + q, k * 100, 0));

                //				buttons[i].onClick.
            }

            j++;
            if (j > 17)
            {
                j = 0;
                k++;
                q = 0;
            }
        }

        values = new float[1000];

        setMinKnobs();
    }
Esempio n. 4
0
    void Start()
    {
        Application.targetFrameRate = 30;

        presets = new string[8];
        d = Dials.Instance;
        d.mult = mult;
        Application.targetFrameRate = 60;
        initInit = initial.transform.position;
        nob = new float[100];
        nob2 = new float[100];
        switch3DObject (0);

        for (int i = 0; i < 8; i++) {
            d.readDials (System.IO.File.ReadAllText ("Assets/athon/data/data_" + i + ".txt"));
        }
        d.checkDials (true);
    }
Esempio n. 5
0
        // byte[] RegisterNum;
        // byte[] RegisterValue;

        // I2CDevice MyI2C;

        public Dial(Dials id, Cpu.Pin interruptPin, ushort i2cAddress) : base()
        {
            dialId = id;
            pinInt = interruptPin;

            //MyI2C = i2cdev;



            i2con = new I2CDevice.Configuration(i2cAddress, 100);


            // the pin will generate interrupt on high and low edges
            intPort = new InterruptPort(pinInt,
                                        true,
                                        Port.ResistorMode.PullUp,
                                        Port.InterruptMode.InterruptEdgeHigh);

            // add an interrupt handler to the pin
            intPort.OnInterrupt += new NativeEventHandler(OnInterrupt);
        }
Esempio n. 6
0
    // Use this for initialization
    void Start()
    {
        d = Dials.Instance;
        d.checkDials (true);
        buttons = new Button[9*2];
        sliders = new Slider[9*2*2];
        int j = 0;
        int k = 0;
        float q = 0;
        for (int i = 0; i < 9*2*2; i++) {
            if (i %9==0)
                q += spacing;

            sliders[i] = Instantiate (slider);
            sliders[i].transform.parent = slider.transform.parent;
            sliders[i].transform.localPosition = slider.transform.localPosition;
            sliders[i].transform.Translate (new Vector3 (j*spacing+q, k*100, 0));
            sliders[i].maxValue = i+1;

            if (i < 18) {
                buttons [i] = Instantiate (button);
                buttons [i].transform.parent = button.transform.parent;
                buttons[i].transform.localPosition = button.transform.localPosition;
                buttons[i].transform.Translate (new Vector3 (j*spacing+q, k*100, 0));

                //				buttons[i].onClick.
            }

            j++;
            if (j > 17) {
                j = 0;
                k++;
                q = 0;
            }

        }

        values = new float[1000];
    }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        d = Dials.Instance;

        d.mult = 10;

        xForm2 = new TreeTransform ();

        p = this.gameObject.AddComponent<TREE>();
        p.setDefaultJoint( defaultJoint);

        TREEUtils.makeDictionary (p.gameObject);

        p.generate (
            "joints",	"1,1",
            "rads",		"3,24",
            "angles",	"120,90",
            "length",	"2.7,5.5",
            "divs",		"1,1",
            "start",	"0,0"
        );

        xForm2.Setup(
            new string[]{
        //				"0|-1|-1|-1|-1|-1|-1",
                "0|-1|-1|-1|-1",
                "0|-1|-1",
            },
            new string[]{
                "ssrz:-1.3,sfrz:4.0,smrz:112,sMult:100.4",
                "ory:6,orx:4",
        //				"ssrx:-1.3,sfrx:1.0,smrx:2,sMult:1.4"
        },p);

        GameObject g = TREEUtils.findJoint (new int[]{0,0,0}, 0, p.gameObject);
    }
Esempio n. 8
0
        // byte[] RegisterNum;
        // byte[] RegisterValue;
        // I2CDevice MyI2C;
        public Dial(Dials id, Cpu.Pin interruptPin, ushort i2cAddress)
            : base()
        {
            dialId = id;
            pinInt = interruptPin;

            //MyI2C = i2cdev;

            i2con = new I2CDevice.Configuration(i2cAddress, 100);

            // the pin will generate interrupt on high and low edges
            intPort = new InterruptPort(pinInt,
                                     true,
                                     Port.ResistorMode.PullUp,
                                     Port.InterruptMode.InterruptEdgeHigh);

            // add an interrupt handler to the pin
            intPort.OnInterrupt += new NativeEventHandler(OnInterrupt);
        }
Esempio n. 9
0
 static void OnDialChanged(Dials DialId, byte newPosition)
 {
 }
Esempio n. 10
0
 static void OnDialChanged(Dials DialId, byte newPosition)
 {
 }