public void GameOver() { GameOverPanel.SetActive(true); GamePanel.SetActive(false); levelManager.LevelFailed(); if (scoreManager.Score > DataManager.GetBestScore()) { DataManager.SetBestScore(scoreManager.Score); } #if UNITY_IOS if (TapticEnabled) { TapticEngine.TriggerError(); } #endif GameAnalytics.NewProgressionEvent(GAProgressionStatus.Fail, Application.version, LevelManager.currentLevel); scoreManager.ResetScore(); }
public void ShootPlayer() { if (GameManager.self.scoreManager.TotalShotsAmount > 0) { GameObject obj = Instantiate(Stickman, transform.position, Quaternion.identity); BotController botController = obj.GetComponent <BotController>(); botControllers.Add(botController); GameManager.self.scoreManager.PlayerShooted(); if (GameManager.self.scoreManager.TotalShotsAmount == 0) { botController.LastStickman(); } #if UNITY_IOS if (GameManager.TapticEnabled) { TapticEngine.TriggerLight(); } #endif } anim.Play(GameManager.self.StringToHashes[49], -1, 0); }
void Awake() { //Set callback method like this to add more functions to listener slider.onValueChanged.AddListener(delegate { SliderTaptic(); }); //Set callback like this if no other functions needed scrollRect.onValueChanged.AddListener(delegate { TapticEngine.TriggerSelectionChange(); }); }
public void Triggered(ContactPoint[] contactPoints, Collision collision) { if (!AIisStanding) { return; } AIisStanding = false; MaincapsuleCollider.enabled = false; DisableKinematic(false); if (MovmentC != null) { StopCoroutine(MovmentC); } if (RunToBombC != null) { StopCoroutine(RunToBombC); } anim.enabled = false; selfMaterial.material = GameManager.self.BotMaterial; if (collision.gameObject.name.Equals(GameManager.HeadName)) { GameManager.self.scoreManager.AddScore(1); } else { GameManager.self.scoreManager.AddScore(1); } #if UNITY_IOS if (GameManager.TapticEnabled) { TapticEngine.TriggerLight(); } #endif if (piramidaController != null) { piramidaController.DisableAboveRagdoll(); } HitEffects.SetActive(true); HitEffects.transform.position = contactPoints[0].point; if (switchParent) { SwitchTransformParent(); } }
public void CollectDiamond() { animator.Play("collectDiamond", -1, 0); GameManager.self.soundManager.diamondSound(); GameManager.self.scoreManager.AddDiamond(); #if UNITY_IOS if (GameManager.TapticEnabled) { TapticEngine.TriggerMedium(); } #endif }
public void FallDown() { if (!AIisStanding) { return; } AIisStanding = false; MaincapsuleCollider.enabled = false; DisableKinematic(false); anim.enabled = false; AddRandomRotation(); selfMaterial.material = GameManager.self.BotMaterial; GameManager.self.scoreManager.AddScore(1); #if UNITY_IOS if (GameManager.TapticEnabled) { TapticEngine.TriggerLight(); } #endif if (piramidaController != null) { piramidaController.DisableAboveRagdoll(); } if (RunToBombC != null) { StopCoroutine(RunToBombC); } if (switchParent) { SwitchTransformParent(); } }
public void Heavy() { Debug.Log("Triggered Heavy Haptic"); TapticEngine.TriggerHeavy(); }
public void Light() { Debug.Log("Triggered Light Haptic"); TapticEngine.TriggerLight(); }
public void Medium() { Debug.Log("Triggered Medium Haptic"); TapticEngine.TriggerMedium(); }
public void Error() { Debug.Log("Triggered Error Haptic"); TapticEngine.TriggerError(); }
public void Success() { Debug.Log("Triggered Success Haptic"); TapticEngine.TriggerSuccess(); }
public void ShowPaletteError(int id) { this.paletterLabel.text = LocalizationService.Instance.GetTextByKey("game_wrongPalette").Replace("1", id.ToString()); base.Open(this.palette, FMPopupManager.FMPopupPriority.ForceOpen); TapticEngine.Trigger(TapticEngine.FeedbackType.Light); }
//Methods called by buttons OnClick public void Warning() { Debug.Log("Triggered Warning Haptic"); TapticEngine.TriggerWarning(); }
void Start() { this.GetComponent <Button>().onClick.AddListener(() => TapticEngine.Selection()); }
void Start() { this.GetComponent <Button>().onClick.AddListener(() => TapticEngine.Notification(this.NotificationType)); }
public void ShowHintPickColor() { base.Open(this.hintSelectColor, FMPopupManager.FMPopupPriority.ForceOpen); TapticEngine.Trigger(TapticEngine.FeedbackType.Light); }
IEnumerator MovementRoutine() { Vector3 startPos; Vector3 endPos; float t; float startT; float currentMovementSpeed = maximumMinumumSpeed.y; charController.Moving(); bool continueMovement = true; ControlEnabled = false; yield return(new WaitForSeconds(0.08f)); GameManager.self.soundManager.fixPitch(); GameManager.self.scoreManager.ResetRawCounter(); while (continueMovement) { #if UNITY_IOS if (GameManager.TapticEnabled) { TapticEngine.TriggerLight(); } #endif ControlEnabled = false; StopFollowStair(); if (!CheckIfGameOverMove()) { startPos = transform.position; StepsCounter += 1; endPos = CalculateNewPos(startPos); StairController enteredStairController = GameManager.self.sceneManager.StairEntered(StepsCounter); GameManager.self.sceneManager.StairPassed(StepsCounter - 1); t = 0; startT = Time.time; while (t < 1) { yield return(new WaitForFixedUpdate()); t = (Time.time - startT) / currentMovementSpeed; transform.position = Vector3.Lerp(startPos, endPos, t); transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.Euler(enteredStairController.transform.localEulerAngles), t); } transform.position = Vector3.Lerp(startPos, endPos, 1); currentMovementSpeed -= movementAcceleration; if (currentMovementSpeed < maximumMinumumSpeed.x) { currentMovementSpeed = maximumMinumumSpeed.x; } StepCompleted(enteredStairController); ControlEnabled = true; continueMovement = isPointerDown; } else { break; } } }
public void ShowWrongColor() { base.Open(this.wrongColor, FMPopupManager.FMPopupPriority.ForceOpen); TapticEngine.Trigger(TapticEngine.FeedbackType.Light); }
public void ShowEmptyHints() { base.Open(this.hintsEmpty, FMPopupManager.FMPopupPriority.Normal); TapticEngine.Trigger(TapticEngine.FeedbackType.Light); }
public void ShowPicSaved() { base.Open(this.picSaved, FMPopupManager.FMPopupPriority.Normal); TapticEngine.Trigger(TapticEngine.FeedbackType.Light); }
public void SelectionChange() { Debug.Log("Triggered Selection Change Haptic"); TapticEngine.TriggerSelectionChange(); }
//Listener private void SliderTaptic() { TapticEngine.TriggerSelectionChange(); Debug.Log("Slider triggered Selection Change"); }
void Start() { this.GetComponent <Button>().onClick.AddListener(() => TapticEngine.Impact(this.ImpactType)); }
public void ShowHintAlreadyPainted() { base.Open(this.hintAlreadyPainted, FMPopupManager.FMPopupPriority.ForceOpen); TapticEngine.Trigger(TapticEngine.FeedbackType.Light); }