コード例 #1
0
 private void SendMessage()
 {
     if (isPlay)
     { //float send = lightDegree * 10000;
         Dmxmanager.GetDmx().ChoseContralLight(mydata.index, lightDegree);
     }
 }
コード例 #2
0
 private void OnDisable()
 {
     isOpen      = false;
     lightDegree = 0;
     Dmxmanager.GetDmx().ChoseContralLight(int.Parse(gameObject.name), lightDegree);
     Debug.LogError(gameObject.name);
 }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        if (!Globaldata.Global.isPause)
        {
            TimerManager.Manager.Update(Time.deltaTime * 100);
            TimerManager.Manager.VideoUpdate(Time.deltaTime * 100);
        }
        // Debug.LogError(Globaldata.Global.pauseTime.Count);

        if (Input.GetKeyDown(KeyCode.S))
        {
            Run();
        }
        if (Input.GetKeyUp(KeyCode.P))
        {
            Stop();
            Globaldata.Global.isPause = false;
        }


        //if (Input.GetKeyDown(KeyCode.L))
        //{
        //    isloop = true;
        //}
        //if (Input.GetKeyDown(KeyCode.F))
        //{
        //    Globaldata.Global.LastPause();
        //}

        //if (Input.GetKeyUp(KeyCode.T))
        //{
        //    // Globaldata.Global.choseDis(0);
        //}


        if (Input.GetKeyUp(KeyCode.Space))
        {
            if (Globaldata.Global.Current != Globaldata.Global.pauseTime.Count - 1)
            {
                Globaldata.Global.isPause = false;
            }
        }
        if (Input.GetKeyUp(KeyCode.D))
        {
            for (int i = 1; i < 500; i++)
            {
                Dmxmanager.GetDmx().ChoseContralLight(i, 0);
            }
        }
        if (Input.GetKeyUp(KeyCode.T))
        {
            for (int i = 0; i < usuallies.Count; i++)
            {
                Dmxmanager.GetDmx().ChoseContralLight(usuallies[i].index, usuallies[i].lightdree);
            }
        }
    }
コード例 #4
0
    public override void Stop()
    {
        isPlay = false;


        TimeSpan ts = DateTime.Now - times;

        // Debug.Log(ts.TotalMilliseconds + "   " + mydata.index);
        Dmxmanager.GetDmx().ChoseContralLight(mydata.index, 0);
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        Screen.SetResolution(1920, 1080, true);
        usuallies.Add(new Usually(4, 5));
        usuallies.Add(new Usually(5, 5));
        usuallies.Add(new Usually(6, 5));
        usuallies.Add(new Usually(9, 5));
        //usuallies.Add(new Usually(64, 5));
        // Application.targetFrameRate = 1000;
        //Time.maximumDeltaTime = 0.01f;
        saveUrl = Application.dataPath + "/saveData/";
        if (!Directory.Exists(saveUrl))
        {
            Directory.CreateDirectory(saveUrl);
        }
        Usually a = new Usually();

        lights.Add(a);

        File.WriteAllText(saveUrl + "saveusually.xml", XmlUtil.Serializer(lights));
        Globaldata.Global.videomanager = FindObjectOfType <VideoManager>();
        Globaldata.Global.eventmanger  = FindObjectOfType <ActionEvent>();
        Globaldata.Global.lineManger   = FindObjectOfType <DrawLine>();
        StartCoroutine(Runaction());
        Globaldata.Global.pointer        = pointer;
        Globaldata.Global.showItemManger = FindObjectOfType <ShowItemManger>();
        Globaldata.Global.top            = top.position;
        Globaldata.Global.bottom         = bottom.position;

        x = rect.localPosition.x - rect.sizeDelta.x / 2;
        ChangeContont();
        StartInit();
        dmxInput.text = Globaldata.Global.dmxPort;
        InvokeRepeating("SaveSet", 0, 60);

        //Invoke("InitTime", 0);
        InitTime();
        threadSecond = new Thread(new ThreadStart(UPdateS));
        threadSecond.Start();
        dmxInput.enabled = true;

        for (int i = 0; i < usuallies.Count; i++)
        {
            Dmxmanager.GetDmx().ChoseContralLight(usuallies[i].index, usuallies[i].lightdree);
        }
    }
コード例 #6
0
    public void RunactionLight()
    {
        while (!quite)
        {
            try
            {
                if (senddata.Length < Globaldata.Global.orthogons.Count)
                {
                    senddata = new float[Globaldata.Global.orthogons.Count];
                }
                for (int i = 0; i < Globaldata.Global.orthogons.Count; i++)
                {
                    try
                    {
                        LightItem temp = (LightItem)Globaldata.Global.orthogons[i];
                        if (temp != null && temp.isPlay)
                        {
                            if (senddata[i] != temp.getLightnum())
                            {
                                //Debug.Log(temp.mydata.index + "index" + temp.getLightnum());
                                senddata[i] = temp.getLightnum();
                                Dmxmanager.GetDmx().ChoseContralLight(temp.mydata.index, temp.getLightnum());
                            }
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
                if (!Globaldata.Global.Isrun)
                {
                    for (int i = 0; i < senddata.Length; i++)
                    {
                        senddata[i] = 0;
                    }
                }

                Thread.Sleep(200);
            }
            catch (Exception e)
            {
                Debug.Log(e.Message);
            }
        }
    }
コード例 #7
0
    public void changLight()
    {
        while (isOpen)
        {
            try
            {
                Dmxmanager.GetDmx().ChoseContralLight(index, lightDegree);
            }
            catch (System.Exception e)
            {
                throw;
            }


            Thread.Sleep(100);
        }
        if (!isOpen)
        {
            lightDegree = 0;
            Dmxmanager.GetDmx().ChoseContralLight(index, lightDegree);
        }
    }
コード例 #8
0
 // Use this for initialization
 public void setLight(int index)
 {
     Dmxmanager.GetDmx().ChoseContralLight(index + 1, (sliders[index].value * 255));
     //this.dmx.Channels[2]= (byte)(slider.value * 255);
     //this.dmx.Channels[3] = (byte)(slider.value * 255);
 }
コード例 #9
0
 public void SetDmxPort(string str)
 {
     Dmxmanager.GetDmx().ChangePort(str);
 }