Exemple #1
0
    //private int[] pat30;
    // Use this for initialization
    void Start()
    {
        //Define frame rate
        Application.targetFrameRate = 60;

        //Set UDPReceiver instance & Port number set
        udprcv = GetComponent<UDPReceiver> ();
        udprcv.PORT_SET_INIT (20321, 20322, 20323, 20324, 20326, 20327);

        //Set serialHandler
        serialHandler = GetComponent<SerialHandler> ();

        //Set indicatorSetter
        indicatorSetter = GetComponent<IndicatorSetter> ();

        //Set indicatorSetter
        stateMachine = GetComponent<StateMachine> ();

        //Set GetComponents (must be put here, or Start() function)
        box1 = systemObj1.GetComponent<Image>();
        box2 = systemObj2.GetComponent<Image>();
        box3 = systemObj3.GetComponent<Image>();
        box4 = systemObj4.GetComponent<Image>();

        //Indicators in pic
        text_Indicator1 = systemObj_I1.GetComponent<Text> ();
        text_Indicator2 = systemObj_I2.GetComponent<Text> ();
        text_Indicator3 = systemObj_I3.GetComponent<Text> ();
        text_Indicator4 = systemObj_I4.GetComponent<Text> ();
        box_Indicator1 = systemObj_boxI1.GetComponent<Text> ();
        box_Indicator2 = systemObj_boxI2.GetComponent<Text> ();
        box_Indicator3 = systemObj_boxI3.GetComponent<Text> ();
        box_Indicator4 = systemObj_boxI4.GetComponent<Text> ();
        text_MessageLog = systemObj_MessageLog.GetComponent<Text> ();

        //(For debug)
        text1 = systemObj5.GetComponent<Text> ();
        //text2 = systemObj6.GetComponent<Text> ();
        textA = systemObj7.GetComponent<Text> ();
        textB = systemObj8.GetComponent<Text> ();
        textC = systemObj9.GetComponent<Text> ();
        textD = systemObj10.GetComponent<Text> ();
        text_PORT1 = systemObj11.GetComponent<Text> ();
        text_PORT2 = systemObj12.GetComponent<Text> ();
        text_PORT3 = systemObj13.GetComponent<Text> ();
        text_PORT4 = systemObj14.GetComponent<Text> ();
        //text_PORT5 = systemObj15.GetComponent<Text> ();

        //Set BoxFlicker instance
        box_A = systemObj1.AddComponent<BoxFlicker>();
        box_B = systemObj2.AddComponent<BoxFlicker>();
        box_C = systemObj3.AddComponent<BoxFlicker>();
        box_D = systemObj4.AddComponent<BoxFlicker>();

        //Set patternArray
        patternArray = GetComponent<PatternArray> ();
        patA = patternArray.getPat7_sin_plus1();
        patB = patternArray.getPat15();
        patC = patternArray.getPat12_sin_plus1();
        patD = patternArray.getPat20_sin_plus1();

        //pat30 = patternArray.getPat30();

        box_A.Setting (patA, box1);
        box_B.Setting (patB, box2);
        box_C.Setting (patC, box3);
        box_D.Setting (patD, box4);
    }
    //private int[] pat30;

    // Use this for initialization
    void Start()
    {
        //Define frame rate
        Application.targetFrameRate = 60;

        //Set UDPReceiver instance & Port number set
        udprcv = GetComponent <UDPReceiver> ();
        udprcv.PORT_SET_INIT(20321, 20322, 20323, 20324, 20326, 20327);

        //Set serialHandler
        serialHandler = GetComponent <SerialHandler> ();

        //Set indicatorSetter
        indicatorSetter = GetComponent <IndicatorSetter> ();

        //Set indicatorSetter
        stateMachine = GetComponent <StateMachine> ();

        //Set GetComponents (must be put here, or Start() function)
        box1 = systemObj1.GetComponent <Image>();
        box2 = systemObj2.GetComponent <Image>();
        box3 = systemObj3.GetComponent <Image>();
        box4 = systemObj4.GetComponent <Image>();

        //Indicators in pic
        text_Indicator1 = systemObj_I1.GetComponent <Text> ();
        text_Indicator2 = systemObj_I2.GetComponent <Text> ();
        text_Indicator3 = systemObj_I3.GetComponent <Text> ();
        text_Indicator4 = systemObj_I4.GetComponent <Text> ();
        box_Indicator1  = systemObj_boxI1.GetComponent <Text> ();
        box_Indicator2  = systemObj_boxI2.GetComponent <Text> ();
        box_Indicator3  = systemObj_boxI3.GetComponent <Text> ();
        box_Indicator4  = systemObj_boxI4.GetComponent <Text> ();
        text_MessageLog = systemObj_MessageLog.GetComponent <Text> ();

        //(For debug)
        text1 = systemObj5.GetComponent <Text> ();
        //text2 = systemObj6.GetComponent<Text> ();
        textA      = systemObj7.GetComponent <Text> ();
        textB      = systemObj8.GetComponent <Text> ();
        textC      = systemObj9.GetComponent <Text> ();
        textD      = systemObj10.GetComponent <Text> ();
        text_PORT1 = systemObj11.GetComponent <Text> ();
        text_PORT2 = systemObj12.GetComponent <Text> ();
        text_PORT3 = systemObj13.GetComponent <Text> ();
        text_PORT4 = systemObj14.GetComponent <Text> ();
        //text_PORT5 = systemObj15.GetComponent<Text> ();

        //Set BoxFlicker instance
        box_A = systemObj1.AddComponent <BoxFlicker>();
        box_B = systemObj2.AddComponent <BoxFlicker>();
        box_C = systemObj3.AddComponent <BoxFlicker>();
        box_D = systemObj4.AddComponent <BoxFlicker>();

        //Set patternArray
        patternArray = GetComponent <PatternArray> ();
        patA         = patternArray.getPat7_sin_plus1();
        patB         = patternArray.getPat15();
        patC         = patternArray.getPat12_sin_plus1();
        patD         = patternArray.getPat20_sin_plus1();

        //pat30 = patternArray.getPat30();

        box_A.Setting(patA, box1);
        box_B.Setting(patB, box2);
        box_C.Setting(patC, box3);
        box_D.Setting(patD, box4);
    }