Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using System.IO.Ports;
- using System.Threading;
- public class SwitchAnimation : MonoBehaviour
- {
- public Animator ramsayAnimator;
- string number = "";
- SerialPort stream = new SerialPort("COM3", 9600);
- //SerialPort serial = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One);
- void start(){
- stream.Open();
- }
- // Update is called once per frame
- void FixedUpdate()
- {
- number = stream.ReadLine();
- if(number == "2"){
- ramsayAnimator.SetBool("bread", true);
- }else{
- ramsayAnimator.SetBool("bread", false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement