void Start() { u = UduinoManager.Instance; // player 1 // pressure sensor u.pinMode(AnalogPin.A0, PinMode.Input); // LED u.pinMode(3, PinMode.Output); // push buttons // left u.pinMode(2, PinMode.Input_pullup); // right u.pinMode(4, PinMode.Input_pullup); // player 2 // pressure sensor u.pinMode(AnalogPin.A3, PinMode.Input); // LED u.pinMode(6, PinMode.Output); // push buttons // left u.pinMode(5, PinMode.Input_pullup); // right u.pinMode(7, PinMode.Input_pullup); // the particle system is OFF //smoochParticle.GetComponent<ParticleSystem>().enableEmission = false; // sprite stuff spriteRend = GetComponent <SpriteRenderer>(); // if the sprite is null, set it to resting sprite }
void Start() { charControl = GetComponent <CharacterController>(); manager = UduinoManager.Instance; manager.pinMode(AnalogPin.A4, PinMode.Input); //JoyX manager.pinMode(AnalogPin.A5, PinMode.Input); //JoyY }
// Start is called before the first frame update void Start() { manager = UduinoManager.Instance; manager.pinMode(AnalogPin.A0, PinMode.Input); manager.pinMode(AnalogPin.A1, PinMode.Input); manager.pinMode(AnalogPin.A2, PinMode.Input); }
// Start is called before the first frame update void Start() { u = UduinoManager.Instance; u.DiscoverPorts(); for (int i = 2; i < 6; i++) { u.pinMode(i, PinMode.Input_pullup); } }
// Start is called before the first frame update void Start() { u = UduinoManager.Instance; u.pinMode(AnalogPin.A0, PinMode.Input); // get audio source for burping sound burp = GetComponent <AudioSource>(); //burp.Play(0); }
void OnEnable() { if (manager == null) { manager = (UduinoManager)target; } FindExistingExtensions(); Instance = this; }
// Use this for initialization void Start() { var rotationVector = transform.rotation.eulerAngles; manager = UduinoManager.Instance; manager.pinMode(AnalogPin.A0, PinMode.Input); //z accel manager.pinMode(AnalogPin.A1, PinMode.Input); //y accel manager.pinMode(AnalogPin.A2, PinMode.Input); //x accel manager.pinMode(AnalogPin.A4, PinMode.Input); //JoyX manager.pinMode(AnalogPin.A5, PinMode.Input); //JoyY }
void Start() { u = UduinoManager.Instance; for (int i = 2; i < 13; i++) { u.pinMode(i, PinMode.Output); } StartCoroutine(BlinkAllLoop()); }
//public bool isPaused; // Start is called before the first frame update void Start() { //isPaused = false; u = UduinoManager.Instance; u.DiscoverPorts(); for (int i = 2; i < 11; i++) { u.pinMode(i, PinMode.Input_pullup); Debug.Log("Pin " + i + " initiated."); } }
// Use this for initialization void Start() { pontuation = 0; limit = 9f; green = 8f; tempo = 0f; max_limit = 20f; manager = UduinoManager.Instance; green_limit.transform.position = new Vector3(0, 12, green); manager.pinMode(AnalogPin.A0, PinMode.Input); //UduinoManager.Instance.pinMode(13, PinMode.Input); }
public override void OnInspectorGUI() { if (manager == null) { manager = (UduinoManager)target; } Log.SetLogLevel(manager.debugLevel); SetColorAndStyles(); DrawLogo(); defaultPanel = DrawHeaderTitle("Uduino Settings", defaultPanel, headerColor); if (defaultPanel) { GUILayout.Label("General", EditorStyles.boldLabel); EditorGUI.indentLevel++; manager.debugLevel = (LogLevel)EditorGUILayout.EnumPopup("Log Level", manager.debugLevel); EditorGUI.indentLevel--; GUILayout.Label("Arduino", EditorStyles.boldLabel); EditorGUI.indentLevel++; // manager.BaudRate = EditorGUILayout.IntField("Baud Rate", manager.BaudRate ); baudRateIndex = EditorGUILayout.Popup("Baud Rate", baudRateIndex, baudRates); if (prevBaudRateIndex != baudRateIndex) { int result = 9600; int.TryParse(baudRates[baudRateIndex], out result); manager.BaudRate = result; prevBaudRateIndex = baudRateIndex; } manager.ReadOnThread = EditorGUILayout.Toggle("Read on threads", manager.ReadOnThread); EditorGUI.indentLevel--; EditorGUILayout.Separator(); } arduinoPanel = DrawHeaderTitle("Adruino", arduinoPanel, headerColor); if (arduinoPanel) { ArduinoSetings(); } advancedPanel = DrawHeaderTitle("Advanced", advancedPanel, headerColor); if (advancedPanel) { AdvancedSettings(); } //TODO : Needed to update when message sent/received. This uses a lot of passes. Maybe change that, do a variable to check if a new value is here EditorUtility.SetDirty(target); }
//Aawke is called once at the beginning of the game. void Start() { //This statement hides cursor. //This part is actually not absolute for our project. For example it should change when we access Menu UI. Also we should disable camera movement on top of it. //Othervise the camera will be moving while we are in the Menu UI. So we might consider making it reactive for different situations. Cursor.lockState = CursorLockMode.Locked; manager = UduinoManager.Instance; manager.pinMode(AnalogPin.A3, PinMode.Input); // accel Z, z<370 UP, 400<z<435 DOWN manager.pinMode(AnalogPin.A1, PinMode.Input); // accel Y, y<300 LEFT, y>420 RIGHT //manager.pinMode(AnalogPin.A6, PinMode.Input); joyButton = 1; }
void Start() { //if (!VR) //SceneManager.LoadScene(2); //GameObject fullscene = GameObject.Find("scene"); pontuation = 0; warning = 2f; limit = start; //SEGUNDOS second_warning = 15f; manager = UduinoManager.Instance; manager.pinMode(AnalogPin.A0, PinMode.Input); audiosource = GetComponent <AudioSource>(); path = string.Format(@"C:\Users\Mirella\Desktop\zombie_game\EMG_GAME\tests\{0}.txt", id.ToString()); path_VR = string.Format(@"C:\Users\Mirella\Desktop\zombie_game\EMG_GAME\tests\{0}_VR.txt", id.ToString()); health = (int)(limit * 1000); }
// Use this for initialization void Start() { manager = UduinoManager.Instance; manager.pinMode(AnalogPin.A2, PinMode.Input); Lock1 = false; Lock2 = false; picRotCheck1 = false; picRotCheck2 = false; picRotCheck3 = false; Lamp1Script = Lamp1Access.GetComponent <Lamp1>(); Lamp2Script = Lamp2Access.GetComponent <Lamp2>(); Lamp3Script = Lamp3Access.GetComponent <Lamp3>(); Lamp4Script = Lamp4Access.GetComponent <Lamp4>(); BlueDoorScript = BlueDoorAccess.GetComponent <BlueDoor>(); RedDoorScript = RedDoorAccess.GetComponent <RedDoor>(); }
void Start() { u = UduinoManager.Instance; // player 1 // pressure sensor u.pinMode(AnalogPin.A0, PinMode.Input); // LED u.pinMode(3, PinMode.Output); // push buttons u.pinMode(4, PinMode.Input_pullup); u.pinMode(2, PinMode.Input_pullup); // player 2 // pressure sensor u.pinMode(AnalogPin.A3, PinMode.Input); // LED u.pinMode(6, PinMode.Output); // push buttons u.pinMode(5, PinMode.Input_pullup); u.pinMode(7, PinMode.Input_pullup); }
// TODO : Faire ça ça veut dire qu'on peut pas envoyer a l'unité pendant l'update void CustomUpdate() { #if UDUINO_READY if (alwaysSend) { string angles = UduinoManager.BuildMessageParameters( EyeControl.Instance.motors[0].RelativePositionToAngle(), EyeControl.Instance.motors[1].RelativePositionToAngle(), EyeControl.Instance.motors[2].RelativePositionToAngle(), EyeControl.Instance.motors[3].RelativePositionToAngle(), EyeControl.Instance.motors[4].RelativePositionToAngle(), EyeControl.Instance.motors[5].RelativePositionToAngle() ); if (angles != lastMessage) { UduinoManager.Instance.sendCommand("ctrl", angles); lastMessage = angles; } } #endif }
public EndGame end; // load the EndGame.cs script void Start() { u = UduinoManager.Instance; // player 1 // pressure sensor u.pinMode(AnalogPin.A0, PinMode.Input); // LED u.pinMode(3, PinMode.Output); // push buttons // left u.pinMode(2, PinMode.Input_pullup); // right u.pinMode(4, PinMode.Input_pullup); // player 2 // pressure sensor u.pinMode(AnalogPin.A3, PinMode.Input); // LED u.pinMode(6, PinMode.Output); // push buttons // left u.pinMode(5, PinMode.Input_pullup); // right u.pinMode(7, PinMode.Input_pullup); // the particle system is OFF //smoochParticle.GetComponent<ParticleSystem>().enableEmission = false; // sprite stuff spriteRend = GetComponent <SpriteRenderer>(); // if the sprite is null, set it to resting sprite var kisseffect = kissparticle.GetComponent <ParticleSystem>().emission; kisseffect.enabled = false; PlayerPrefs.SetString("p1Ready", "no"); PlayerPrefs.SetString("p2Ready", "no"); // global vars to tell whether players are ready to kiss }
public override void OnInspectorGUI() { if (manager == null) { manager = (UduinoManager)target; baudRateIndex = System.Array.IndexOf(baudRates, manager.BaudRate.ToString()); } Log.SetLogLevel(manager.debugLevel); SetColorAndStyles(); DrawLogo(); defaultPanel = DrawHeaderTitle("Uduino Settings", defaultPanel, headerColor); if (defaultPanel) { CheckCompatibility(); GUILayout.Label("General", EditorStyles.boldLabel); EditorGUI.indentLevel++; manager.debugLevel = (LogLevel)EditorGUILayout.EnumPopup("Log Level", manager.debugLevel); EditorGUI.indentLevel--; GUILayout.Label("Arduino", EditorStyles.boldLabel); EditorGUI.indentLevel++; baudRateIndex = EditorGUILayout.Popup("Baud Rate", baudRateIndex, baudRates); if (prevBaudRateIndex != baudRateIndex) { int result = 9600; int.TryParse(baudRates[baudRateIndex], out result); manager.BaudRate = result; prevBaudRateIndex = baudRateIndex; } manager.ReadOnThread = EditorGUILayout.Toggle("Read on threads", manager.ReadOnThread); EditorGUI.indentLevel--; GUILayout.Label("Messages", EditorStyles.boldLabel); EditorGUI.indentLevel++; if (manager.LimitSendRate = EditorGUILayout.Toggle("Limit Send Rate", manager.LimitSendRate)) { if (manager.LimitSendRate) { manager.SendRateSpeed = EditorGUILayout.IntField("Send Rate speed", manager.SendRateSpeed); EditorGUILayout.Separator(); } } EditorGUI.indentLevel--; EditorGUILayout.Separator(); } arduinoPanel = DrawHeaderTitle("Adruino", arduinoPanel, headerColor); if (arduinoPanel) { ArduinoSetings(); } advancedPanel = DrawHeaderTitle("Advanced", advancedPanel, headerColor); if (advancedPanel) { AdvancedSettings(); } // if (GUI.changed) EditorUtility.SetDirty(target); }
// Start is called before the first frame update void Start() { closedCircuit = false; manager = UduinoManager.Instance; manager.pinMode(3, PinMode.Input); }
void Start() { u = UduinoManager.Instance; u.InitPin(AnalogPin.A0, PinMode.Analog); u.InitPin(11, PinMode.PWM); }
void Start() { u = UduinoManager.Instance; u.pinMode(AnalogPin.A0, PinMode.Input); u.pinMode(11, PinMode.PWM); }
public override void OnInspectorGUI() { if (manager == null) { manager = (UduinoManager)target; } baudRateIndex = System.Array.IndexOf(baudRates, Manager.BaudRate.ToString()); Log.SetLogLevel(manager.debugLevel); SetColorAndStyles(); DrawLogo(); defaultPanel = DrawHeaderTitle("Uduino Settings", defaultPanel, headerColor); if (defaultPanel) { CheckCompatibility(); GUILayout.Label("Connection type", EditorStyles.boldLabel); EditorGUI.indentLevel++; Dictionary <string, UduinoExtension> availableExtensions = new Dictionary <string, UduinoExtension>(Manager.AvailableExtensions); foreach (KeyValuePair <string, UduinoExtension> u in availableExtensions) { if (u.Value.isPresent) { GUILayout.BeginHorizontal(); bool isActiveValue = EditorGUILayout.Toggle(u.Value.name, u.Value.isActive); if (isActiveValue != u.Value.isActive) { UduinoExtension changedExtension = u.Value; changedExtension.isActive = isActiveValue; Manager.AvailableExtensions.Remove(u.Key); Manager.AvailableExtensions.Add(u.Key, changedExtension); } GUILayout.EndHorizontal(); } } EditorGUI.indentLevel--; GUILayout.Label("General", EditorStyles.boldLabel); EditorGUI.indentLevel++; LogLevel tmpLogLevel = (LogLevel)EditorGUILayout.EnumPopup("Log Level", Manager.debugLevel); if (tmpLogLevel != Manager.debugLevel) { Manager.debugLevel = tmpLogLevel; EditorUtility.SetDirty(target); } EditorGUI.indentLevel--; GUILayout.Label("Arduino", EditorStyles.boldLabel); EditorGUI.indentLevel++; baudRateIndex = EditorGUILayout.Popup("Baud Rate", baudRateIndex, baudRates); if (prevBaudRateIndex != baudRateIndex) { int result = 9600; int.TryParse(baudRates[baudRateIndex], out result); manager.BaudRate = result; prevBaudRateIndex = baudRateIndex; } Manager.ReadOnThread = EditorGUILayout.Toggle("Read on threads", Manager.ReadOnThread); EditorGUI.indentLevel--; GUILayout.Label("Messages", EditorStyles.boldLabel); EditorGUI.indentLevel++; if (manager.LimitSendRate = EditorGUILayout.Toggle("Limit Send Rate", Manager.LimitSendRate)) { if (manager.LimitSendRate) { Manager.SendRateSpeed = EditorGUILayout.IntField("Send Rate speed", Manager.SendRateSpeed); EditorGUILayout.Separator(); } } EditorGUI.indentLevel--; EditorGUILayout.Separator(); CheckUpdate(); } arduinoPanel = DrawHeaderTitle("Adruino", arduinoPanel, headerColor); if (arduinoPanel) { ArduinoSettings(); } advancedPanel = DrawHeaderTitle("Advanced", advancedPanel, headerColor); if (advancedPanel) { AdvancedSettings(); } //TODO : We add that here beacause we the values serialized are not updated if (!Application.isPlaying) { EditorUtility.SetDirty(target); } }