示例#1
0
    // ================= PUBLIC FACING ================== //


    // ----------------------------------------------------
    // name: SyncInt
    // desc: start checking chuck for intToSync so that
    //       later, you can get it whenever you want
    // ----------------------------------------------------
    public void SyncInt(ChuckSubInstance chuck, string intToSync)
    {
        // cancel existing if it's happening
        StopSyncing();

        // start up again
        myChuck       = chuck;
        myIntName     = intToSync;
        myIntCallback = Chuck.CreateGetIntCallback(MyCallback);
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        newRound        = true;
        otherReady      = false;
        startTheTicker  = false;
        sent1000        = false;
        goToNextStep    = false;
        instructionMesh = (TextMesh)instructionText.GetComponent(typeof(TextMesh));

        prevBeat       = 0;
        beat           = 0;
        timeOfLastBeat = 0;
        beatBufferTime = .09f;
        prevBeatLength = 0;

        currLetter = 0;
        linePos    = 0.0f;

        topColor     = new Color32(255, 56, 129, 255);
        bottomColor  = new Color32(63, 56, 255, 255);
        correctColor = new Color32(56, 224, 101, 255);

        myChuck          = GetComponent <ChuckInstance> ();
        myGetIntCallback = Chuck.CreateGetIntCallback(GetIntCallback);
        myCallback       = Chuck.CreateVoidCallback(NewMessageReceived);
        message          = -1;
        newMessage       = false;

        mainScript = main.GetComponent <MainController> ();

        initialTickerX = ticker.transform.position.x;

        for (int i = 0; i < acceptableKeys.GetLength(0); i++)
        {
            acceptableKeys[i, 2] = (i + 72).ToString();
        }
        //set space to none
        acceptableKeys[acceptableKeys.GetLength(0) - 1, 2] = "0";

        //create container to have new keys added
        currKeysTop = new GameObject("currKeysTop");
        currKeysTop.AddComponent <MeshFilter>();
        currKeysTop.AddComponent <MeshRenderer>();
        currKeysBottom = new GameObject("currKeysBottom");
        currKeysBottom.AddComponent <MeshFilter>();
        currKeysBottom.AddComponent <MeshRenderer>();
    }
示例#3
0
 // ----------------------------------------------------
 // name: CreateGetIntCallback
 // desc: construct the callback necessary for GetInt
 // ----------------------------------------------------
 public Chuck.IntCallback CreateGetIntCallback(Action <System.Int64> callbackFunction)
 {
     return(Chuck.CreateGetIntCallback(callbackFunction));
 }