示例#1
0
    // Update is called once per frame
    void Update()
    {
        Vector3 localPosition = transform.localPosition;

        HeartBeat.BeatSize beatSize = heartbeat.GetBeatAtTime(Time.time);
        localPosition.y = beatSize.ElectricalPulse;
        //localPosition.y = Mathf.Sin(Time.time);
        //localPosition.x = Time.time;
        transform.localPosition = localPosition;
    }
示例#2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        float curTime = Time.time;

        HeartBeatEntry entry = new HeartBeatEntry();

        entry.time     = curTime;
        entry.beatSize = sourceHeartBeat.GetBeatAtTime(curTime);
        entry.entryId  = sourceHeartBeat.GetCurrentBeatId();
        entries.Enqueue(entry);
        while (entries.Peek().time < curTime - queueTimeSeconds)
        {
            entries.Dequeue();
        }
    }