示例#1
0
 // Should be called after creation
 public virtual void Init()
 {
     controller = Controller.Instance;
     penrose    = controller.penrose;
     tiles      = penrose.Tiles;
     buffer     = new Color[Penrose.Total];
 }
示例#2
0
 public void Init()
 {
     controller        = Controller.Instance;
     penrose           = controller.penrose;
     tiles             = penrose.Tiles;
     setting           = new Settings();
     listenerOpenPixel = new UDPReceive(8500, handleOpenPixel);
     hits = new float[5];
 }
示例#3
0
    // Use this for initialization
    void Start()
    {
        penrose = GameObject.FindObjectOfType <Penrose>();

        effects    = new Effect[4];
        effects[0] = new Nibbler();
        effects[1] = new ColorSparkle();
        effects[2] = new Noise();
        effects[3] = new Pulse();

        foreach (var effect in effects)
        {
            effect.Init();
        }

        effects[currentEffect].LoadSettings();

        geometry = new Tiles();
        timeLeft = effectTime;

        effectText.text = ((EffectTypes)currentEffect).ToString();
    }
示例#4
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());
    }