Пример #1
0
    // Use this for initialization
    void Start()
    {
        Application.targetFrameRate = 60;
        OSCtimer = 0;

        penrose = GameObject.FindObjectOfType <Penrose>();
        penrose.Init();

        myIPText.text = GetLocalIPv4();

        SetupEffects();
        SetupTransitions();
        try
        {
            setupUDP();
        }
        catch (Exception e)
        {
            Debug.Log($"Failed to setup UDP: {e.Message}");
        }

        osc = gameObject.AddComponent(typeof(OSCReader)) as OSCReader;
        osc.SetAllMessageHandler(OscHandler);
        dance = new Dance();
        dance.Init();
        drum = new drums();
        drum.Init();
        readACN = new ACNHandler();
        readACN.Init();

        cameraOverlay = new CameraReader();
        cameraOverlay.Init((int)penrose.Bounds.size.x, (int)penrose.Bounds.size.y, Penrose.Total);

        timer             = new Timer(effectTime, false);
        timer.onFinished += OnTimerFinished;

        effectText.text = effects[currentEffect].GetType().ToString();
        StartCoroutine(Fps());
    }