Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     currFace = getFace(transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
     rend.material.SetColor("_Color", Color.Lerp(rend.material.color, colors[currFace], Time.deltaTime * transitionRate));
     if (Input.GetMouseButtonDown(0))
     {
         Debug.Log("clicked " + currFace + "!");
         AnimationBuffer.GetBuffer().Add(AnimationBuffer.GetBuffer().Count + 1, currFace);
     }
 }
Beispiel #2
0
    private void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            instance = this;
        }

        spawner      = GetComponent <Spawner>();
        UIHandler    = GetComponent <UIHandler>();
        animBuffer   = GetComponent <AnimationBuffer>();
        audioHandler = GetComponent <AudioHandler>();
    }
 public override void Animate(double ticks, AnimationBuffer frame)
 {
     int i = 0;
     foreach (KeyValuePair<Channel, bool> m in frame.Mask) if (m.Value) i++;
     string[] joints = new string[i];
     double[] values = new double[i];
     double[] speed = new double[i];
     i = 0;
     foreach (KeyValuePair<Channel, double> channel in frame.Values) 
         if (frame.Mask[channel.Key])
         {
             joints[i] = channel.Key.FullName;
             speed[i] = frame.Speed[channel.Key];
             values[i++] = channel.Value*frame.Passthrough[channel.Key] + (1-frame.Passthrough[channel.Key])*outputState.Values[channel.Key];
         }
     nao.Animate(ticks, joints, values, speed, frame.DeltaSeconds, frame.FrameType.ToString());
 }
 void nao_HeartbeatEcho(Double ticks, string[] joints, double[] value)
 {
     AnimationBuffer ab = new AnimationBuffer(nutty.BodyModel, ticks - DateTime.Now.Ticks);
     for (int i = 0; i < joints.Length;i++)
     {
         string channelName = joints[i];
         foreach (BodySet b in ab.BodyModel.BodySets.Values)
             if (b.Contains(channelName))
             {
                 channelName = b.Channels[joints[i]].FullName;
                 break;
             }
         if (ab.BodyModel.AllChannels.ContainsKey(channelName)) ab.SetChannelValue(ab.BodyModel.AllChannels[channelName], value[i]);
     }
     
     outputState = ab;
     NotifyHeartbeatEcho(ticks, ab);
 }
Beispiel #5
0
 private void Awake()
 {
     gm             = GetComponent <GameManager>();
     backgroundRays = backgroundRays.GetComponent <ParticleSystem>();
     animBuffer     = GetComponent <AnimationBuffer>();
 }
Beispiel #6
0
 private void Awake()
 {
     gm         = GetComponent <GameManager>();
     animBuffer = GetComponent <AnimationBuffer>();
 }