protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); mode |= modes.downOut; mode &= ~modes.downIn; wakeup(); }
protected override void OnLostFocus(EventArgs e) { base.OnLostFocus(e); mode |= modes.focusOut; mode &= ~modes.focusIn; wakeup(); }
protected override void OnKeyUp(KeyEventArgs e) { base.OnKeyUp(e); mode |= modes.downOut; mode &= ~modes.downIn; wakeup(); }
private float CalculateTakeStamina(float diff, modes mode) { if (!this.IsStaminaEnabled) { return(0.0f); } double high = 0.0; if (settings.sneakStuffEnabled.Value && (mode & modes.sneak) != modes.none) { if ((mode & (modes.run | modes.sprint)) != modes.none) { high = settings.sneakRunStamina.Value; } else if ((mode & modes.walk) != modes.none) { high = settings.sneakWalkStamina.Value; } else { high = settings.sneakIdleStamina.Value; } } if (settings.runStuffEnabled.Value && (mode & modes.run) != modes.none) { high = Math.Max(high, settings.runStamina.Value); } return((float)high * diff); }
// switches what mode Dog AI is in void Update() { if (GoFetch)//to communicate with player when they click left mouse { mode = modes.Fetch; } switch (mode) { case modes.Passive: DogPassive(); break; case modes.Fetch: DogFetch(); break; case modes.Stay: DogStay(); break; default: break; } if (Input.GetKeyDown(KeyCode.Space)) { mode = modes.Passive; DogBark(); } }
//kain minus mode private void KainbackMode() { if (currentMode == 0) { currentMode = currentMode + System.Enum.GetValues(typeof(modes)).Length - 1; } else { currentMode = currentMode - 1; } if ((int)currentMode == System.Enum.GetNames(typeof(modes)).Length) { currentMode = 0; } letGo(); if (selected != null) { selected.GetComponent <atom>().bonding = false; selected = null; } Text.changeText(currentMode.ToString()); Text.changeColor((int)currentMode); Haptic(); }
public void Reverse() { switch (mode) { case modes.once: mode = modes.reverse; break; case modes.reverse: mode = modes.once; break; case modes.pingPong: pingPongDirection = pingPongDirection == -1 ? 1 : -1; break; case modes.loop: mode = modes.reverseLoop; break; case modes.reverseLoop: mode = modes.loop; break; } }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); mode |= modes.mouseOut; mode &= ~modes.mouseIn; wakeup(); }
void OnEnable() { // GoFetch = false; mode = modes.Passive; FloorMask = LayerMask.GetMask("Floor"); player = GameObject.FindGameObjectWithTag("Player"); agent = GetComponent <NavMeshAgent>(); }
//If nothing is found, return to Passive void EndSearch() { CancelInvoke(); mode = modes.Passive; agent.speed = BaseSpeed; SearchTarget = Vector3.zero; changeTarget(); }
public Form1() { InitializeComponent(); CurrentMode = modes.Select; ColorB.BackColor = colorDialog1.Color; actions.Add(new Action("<Poczatek>")); listBox1.DataSource = actions; }
void Start() { Data.Instance.ui.SetStatus(true); Data.Instance.ui.ShowCapture(false); Data.Instance.ui.ShowBack(false); mode = modes.WORLD; Data.Instance.ui.HideTimer(); Events.OnMap(); }
// runs when the game starts void Awake() { //kain added kainmode true kainmode = true; Text = GetComponentInChildren <UIText>(); trackedObj = GetComponentInParent <SteamVR_TrackedObject>(); currentMode = modes.create; }
//Enter chase; go to the player while they are in sight, try to kill, then search area public void EnterChase(Vector3 tr) { //Cancel any current invokes, in case one is running from a previous Alert CancelInvoke(); NavTarget = null; SearchTarget = tr; mode = modes.Chase; agent.speed = ChaseSpeed; }
public void EnterAlert(Vector3 tr) { //Cancel any current invokes, in case one is running from a previous Alert or Chase CancelInvoke(); NavTarget = null; SearchTarget = tr; Invoke("EndSearch", AlertTime); mode = modes.Alert; agent.speed = BaseSpeed; }
protected override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e); if (e.KeyCode == Keys.Space || e.KeyCode == Keys.Enter) { mode |= modes.downIn; mode &= ~modes.downOut; wakeup(); } }
private void wakeup() { bool sleep = (mode & modes.sleep) == modes.sleep; if (sleep) { restart(); mode &= ~modes.sleep; } }
/// <summary> /// Initializes an A Major scale. /// </summary> public Scale() //TODO do something about these constructors dude. { Key = note.A; ModalKey = note.A; currentMode = modes.ionian; Name = note.A.ToString() + " " + scaleType.major.ToString(); AssignUpperAndLower(ScaleBook.allScales [scaleType.major]); upperTetraOffset = upperTetra.Offset; Intervals = CombineTetrachords(lowerTetra, upperTetra, upperTetraOffset); Notes = GenerateNotes(ModalKey, Intervals); scaleSize = Intervals.Length; }
/// <summary> /// Initializes a scale by key and type, adds the id to name. /// </summary> /// <param name="inKey">Desired Key.</param> /// <param name="type">Desired Scale Type.</param> /// <param name="id">Identifier.</param> public Scale(note inKey, scaleType type, int id) { Key = inKey; ModalKey = inKey; currentMode = modes.ionian; Name = inKey.ToString() + " " + type.ToString() + " _" + id.ToString(); AssignUpperAndLower(ScaleBook.allScales [type]); upperTetraOffset = upperTetra.Offset; Intervals = CombineTetrachords(lowerTetra, upperTetra, upperTetraOffset); Notes = GenerateNotes(Key, Intervals); scaleSize = Intervals.Length; }
public void SetMode(modes newMode) { selectedPoints.Clear(); startVolumeDraw = Vector3.zero; volumeDrawPoints.Clear(); selectedPoint = -1; data.plan.CheckPlan(); _mode = newMode; RenderFloorPlan(); }
public void ChangeScaleMode(Scale managedScale, modes newMode) { if (newMode > modes.locrian) { newMode = modes.ionian; } managedScale.ChangeMode(newMode); foreach (Note n in managedScale.Notes) { n.FrequencyKey += baseNoteOffset; } }
void Start() { mode = modes.playing; if (GameObject.FindWithTag("makesEyeContact") != null) { makesEyeContact = GameObject.FindWithTag("makesEyeContact").GetComponent <Transform>(); isMakesEyeContact = true; } else { isMakesEyeContact = false; } }
private void OnDepletedStamina(Actor actor, modes m) { if (settings.runStuffEnabled.Value && settings.runBlock.Value) { this.SetRunningEnabled(false); } if (settings.sneakStuffEnabled.Value && settings.sneakBlock.Value && actor.IsSneaking) { actor.IsSneaking = false; } this.FlashStaminaBar(); }
public void ToogleMode() { if (mode == modes.SINGLEPLAYER) { mode = modes.MULTIPLAYER; } else { mode = modes.SINGLEPLAYER; } PlayerPrefs.SetString("mode", mode.ToString()); Events.OnChangePlayMode(mode); print("ToogleMode mode: " + mode); }
public void CreateDiatonicChords(Scale managedScale) { int size = managedScale.ScaleSize; managedScale.DiatonicChords = new Chord[size - 1]; modes currentMode = modes.ionian; for (int i = 0; i < size - 1; i++) { managedScale.ChangeMode(currentMode); managedScale.DiatonicChords [i] = new Chord(managedScale.ModalKey, managedScale.ParseRootChord()); currentMode++; } }
private void changeMode(modes targetMode) { this.currentMode = targetMode; switch (this.currentMode) { case modes.Show: this.initShow(); break; case modes.Edit: this.initEdit(); break; } }
private void sleep() { mode |= modes.sleep; bool downIn = (mode & modes.downIn) == modes.downIn; bool downOut = (mode & modes.downOut) == modes.downOut; bool focusIn = (mode & modes.focusIn) == modes.focusIn; bool focusOut = (mode & modes.focusOut) == modes.focusOut; bool mouseIn = (mode & modes.mouseIn) == modes.mouseIn; bool mouseOut = (mode & modes.mouseOut) == modes.mouseOut; if (!downIn && !focusIn && !mouseIn && !downOut && !focusOut && !mouseOut) { stop(); } }
// Start is called before the first frame update void Start() { // this is for the machine learning // make sure vision is tagged vision GameObject visionObj = GameObject.FindWithTag("vision"); //observation = observationObj.GetComponent<Text>(); observation = visionObj.GetComponent <Examples.ARKitExample2>()._text;//ARKitExample2._text; certainty = ""; observationObj = GameObject.FindWithTag("debugText1"); snobBogSays = GameObject.FindWithTag("debugText0").GetComponent <Text>(); canvas = GameObject.FindWithTag("canvas"); initValues(); DateTime now = DateTime.Now; // the following line gets datetime as a string and turns it back into into datetime, but frist converting that // string to binary (in64) then into datetime DateTime startDate = DateTime.FromBinary(long.Parse((PlayerPrefs.GetString("startDate", now.ToBinary().ToString())))); seasonNum = PlayerPrefs.GetInt("seasonNum", 0); // whicih season to load for each characters double daysSince = (now - startDate).TotalDays; // TODO: figure out why this is changing from launch to launch if (startDate == now) { PlayerPrefs.SetString("startDate", now.ToBinary().ToString()); } else if (daysSince >= daysWaitBetween) { seasonNum++; PlayerPrefs.SetInt("seasonNum", seasonNum); } if (seasonNum >= numSeasons) { seasonNum = 0; PlayerPrefs.SetInt("seasonNum", seasonNum); } startInfo = String.Format("loading seasons {0}\n {1} days left til next season loads.", seasonNum, Mathf.Round((float)(daysWaitBetween - daysSince))); doubleTapTimer = 0; tapCount = 0; mode = modes.looking; }
//method used to change the shotting mode public void ChangeMode() { if (modeText == null) { return; } if (mode == modes.ray) { mode = modes.projectile; modeText.text = "Mode: Projectile"; } else { mode = modes.ray; modeText.text = "Mode: Ray"; } }
void initLobby() { //clear all data for (int i = 0; i < board.Length; i++) { for (int j = 0; j < board.Length; j++) { Destroy(board[i, j]); } } for (int i = 0; i < player1Pieces.Count; i++) { Destroy(player1Pieces[i]); } player1Pieces.Clear(); for (int i = 0; i < player2Pieces.Count; i++) { Destroy(player2Pieces[i]); } player2Pieces.Clear(); playerTurnCount = 0; currentGameMode = modes.LOBBY; if (isServer) { //is server activate ui stuff player1Drop.gameObject.SetActive(true); player2Drop.gameObject.SetActive(true); modeDropDown.gameObject.SetActive(true); } else { //is client player1Drop.gameObject.SetActive(false); player2Drop.gameObject.SetActive(false); modeDropDown.gameObject.SetActive(false); //show text sayign wiating on server } }
private void glControl1_MouseDown(object sender, MouseEventArgs e) { if (CurrentMode == modes.Nothing && e.Button == System.Windows.Forms.MouseButtons.Left) { CurrentMode = modes.DrawingCurve; currentCurve = new Boundary(); currentCurve.pts.Add(ScreenToModel(e.X, e.Y)); } else if (CurrentMode == modes.DrawingCurve && e.Button == System.Windows.Forms.MouseButtons.Left) { currentCurve.pts.Add(ScreenToModel(e.X, e.Y)); } else if (CurrentMode == modes.DrawingCurve && e.Button == System.Windows.Forms.MouseButtons.Right) { // finish drawing a curve CurrentMode = modes.Nothing; model.boundaries.Add(currentCurve); } glControl1.Invalidate(); }
private void traiterDonneesRecues(string donneesRecues) { if (donneesRecues == ACQUITTEMENT) { supprimerPaquetEnTete(); this.estDerniereTrameAquitee = true; tenterDEnvoyerLeProchainPaquet(); } else { this.dernierMode = modes.JOUR; if (donneesRecues == REPONSE_NUIT) { this.dernierMode = modes.NUIT; } supprimerPaquetEnTete(); this.dernierModeRecu = true; this.tenterDEnvoyerLeProchainPaquet(); } }
public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = SCREENWIDTH; graphics.PreferredBackBufferHeight = SCREENHEIGHT; graphics.IsFullScreen = false; graphics.PreferMultiSampling = false; Content.RootDirectory = "Content"; mode = modes.splash; main1Camera = new Camera(PlayerIndex.One, this); main2Camera = new Camera(PlayerIndex.Two, this); p1Camera = new Camera(PlayerIndex.One, this); p2Camera = new Camera(PlayerIndex.Two, this); main1Camera.matrix = Matrix.Identity; main2Camera.matrix = Matrix.Identity; p1Camera.matrix = Matrix.Identity; p2Camera.matrix = Matrix.Identity; setCameras(null); debugText = false; }
internal void setMode(modes mode) { MediaPlayer.Stop(); this.mode = mode; splashScreen = null; if (mode == modes.duel) { p1Screen = new DuelScreen(this, PlayerIndex.One); p2Screen = new DuelScreen(this, PlayerIndex.Two); MediaPlayer.Play(MUSIC_BG2); } else if (mode == modes.title) { mainScreen = new MenuScreen(this); MediaPlayer.Play(MUSIC_BG); } }
// Update is called once per frame void Update() { if(gun.GetComponent<Animator>().GetBool("gunMode") && Input.GetMouseButtonDown(1)) { gun.GetComponent<Animator>().SetBool("ADS", true); gun.GetComponent<Animator>().GetBool("gunMode"); } if (Input.GetMouseButtonUp(1)) { gun.GetComponent<Animator>().SetBool("ADS", false); } if ((Input.GetKeyDown(KeyCode.T) && !safety) || ((Input.GetKeyDown(KeyCode.I) && cheatMode))) { if (interactionMode == modes.admire) interactionMode = modes.annihilate; else interactionMode = modes.admire; safety = true; } if((interactionMode == modes.annihilate) && (currentMode == modes.admire)) { currentMode = modes.annihilate; iPrompt.SetActive(false); armTime = Time.time; gunObj1.SetActive(true); handObj1.SetActive(false); gun.GetComponent<Animator>().SetBool("gunMode", true); arming = true; } if ((interactionMode == modes.admire) && (currentMode == modes.annihilate)) { currentMode = modes.admire; gunObj2.SetActive(false); gunObj3.SetActive(false); gunObj4.SetActive(false); gunObj5.SetActive(false); handObj1.SetActive(true); handObj2.SetActive(true); print("DISARMING"); gunObj1.GetComponent<rifleKick>().enabled = false; //gunObj1.GetComponent<Animator>().enabled = true; gun.GetComponent<Animator>().SetBool("gunMode", false); //gunObj1.SetActive(true); } if((Time.time > (armTime + armDelay)) && (currentMode == modes.annihilate)) { //gunObj1.GetComponent<Animator>().enabled = false; gunObj1.GetComponent<rifleKick>().enabled = true; gunObj2.SetActive(true); gunObj3.SetActive(true); gunObj4.SetActive(true); gunObj5.SetActive(true); handObj2.SetActive(false); arming = false; } }