private void OnMouseDown() { GetComponent <AudioSource>().Play(); if (GameManager.CurrentConfig.Vibration) { Taptic.Light(); } switch (GameManager.gameState) { case GameState.Level: EventManager.instance.Fire(new CallBackToSelectLevel()); break; case GameState.SelectLevelMenu: EventManager.instance.Fire(new CallBackToMainMenu()); break; case GameState.Info: EventManager.instance.Fire(new CallBackToMainMenu()); break; case GameState.Setting: EventManager.instance.Fire(new CallBackToMainMenu()); break; } }
private void OnMouseDown() { if (GameManager.gameState == GameState.MainMenu) { if (GameManager.CurrentConfig.Vibration) { Taptic.Light(); } GetComponent <AudioSource>().Play(); switch (Type) { case MainMenuButtonType.PlayButton: EventManager.instance.Fire(new CallLoadLevel(LoadLevelType.FromMainMenu, GameManager.CurrentSaveInfo.CurrentLevel)); break; case MainMenuButtonType.SelectLevelButton: EventManager.instance.Fire(new CallGoToSelectLevel()); break; case MainMenuButtonType.InfoButton: EventManager.instance.Fire(new CallGoToInfo()); break; case MainMenuButtonType.SettingButton: EventManager.instance.Fire(new CallGoToSetting()); break; } } }
public static void Light(bool isVibration = true) { if (isVibration) { Taptic.Light(); //Debug.Log("Vibro: light"); } }
private void OnMouseDown() { if (GameManager.CurrentConfig.Vibration) { GameManager.CurrentConfig.Vibration = false; CheckMark.SetActive(false); } else { GameManager.CurrentConfig.Vibration = true; CheckMark.SetActive(true); Taptic.Light(); } }
private void OnMouseDown() { if (!Swtiching && GameManager.gameState == GameState.SelectLevelMenu) { if (GameManager.CurrentConfig.Vibration) { Taptic.Light(); } GetComponent <AudioSource>().Play(); ResetButton(); SelectedEffect.GetComponent <Image>().enabled = true; EventManager.instance.Fire(new CallLoadLevel(LoadLevelType.FromSelectionMenu, LevelIndex, gameObject)); } }
private void OnMouseDown() { if (!Shaking && GameManager.gameState == GameState.SelectLevelMenu) { Taptic.Light(); GetComponent <AudioSource>().Play(); StartCoroutine(ClickedShake()); if (Right) { transform.root.GetComponent <SelectLevelMenuManager>().IncreaseLevel(); } else { transform.root.GetComponent <SelectLevelMenuManager>().DecreaseLevel(); } } }
public void Eat(float val) { Taptic.Light(); float firstExpirience = CurrentExpireance; int StartLenth = scoreHandler.Lenth; CurrentExpireance += val; while (CurrentExpireance > ExpireanceToLevelUp) { LeveLUp(); } //float LastPart = CurrentExpireance / ExpireanceToLevelUp; //Debug.Log("LastP" + LastPart + " cur exp" + CurrentExpireance +" exp to lvl up" + ExpireanceToLevelUp); ScoreManager.instance.ExpirianceEarned?.Invoke(firstExpirience, CurrentExpireance, ExpireanceToLevelUp); }
public void TriggerTaptic(string type) { if (type == "warning") { Taptic.Warning(); } else if (type == "failure") { Taptic.Failure(); } else if (type == "success") { Taptic.Success(); } else if (type == "light") { Taptic.Light(); } else if (type == "medium") { Taptic.Medium(); } else if (type == "heavy") { Taptic.Heavy(); } else if (type == "default") { Taptic.Default(); } else if (type == "vibrate") { Taptic.Vibrate(); } else if (type == "selection") { Taptic.Selection(); } }
private void CheckLevelState() { for (int i = 0; i < Map.Count; i++) { for (int j = 0; j < Map[i].Count; j++) { if (Map[i][j] != null && Map[i][j].slotType == SlotType.Target) { if (Map[i][j].InsideBubbleType == BubbleType.Null) { return; } } } } if (GameManager.CurrentConfig.Vibration) { Taptic.Light(); } EventManager.instance.Fire(new CallLoadLevel(LoadLevelType.LevelFinish, LevelIndex + 1)); }
public static void Vibrate(VibrationType vibrationType) { switch (vibrationType) { case VibrationType.Light: if (PlayerDataController.data.isVibrationOpen) { Taptic.Light(); } break; case VibrationType.Medium: if (PlayerDataController.data.isVibrationOpen) { Taptic.Medium(); } break; case VibrationType.Success: if (PlayerDataController.data.isVibrationOpen) { Taptic.Success(); } break; case VibrationType.Failure: if (PlayerDataController.data.isVibrationOpen) { Taptic.Failure(); } break; default: break; } }
void OnTriggerEnter(Collider other) { if (other.gameObject == follow.target.gameObject) { cart = other.gameObject.transform.parent.gameObject; follow.target = other.gameObject.transform.parent.transform.GetChild(5).transform; follow.smoothSpeed = 0.02f; } if (other.gameObject == follow.target.transform.parent.GetChild(5).transform.gameObject) { //this.gameObject.GetComponent<MeshRenderer>().enabled = false; this.gameObject.SetActive(false); if (SceneManager.GetActiveScene().buildIndex == 2 || SceneManager.GetActiveScene().buildIndex == 5 || SceneManager.GetActiveScene().buildIndex == 6) { other.gameObject.transform.parent.transform.GetChild(3).transform.gameObject.GetComponent <Weight>().weight += 2.6f; } else { other.gameObject.transform.parent.transform.GetChild(3).transform.gameObject.GetComponent <Weight>().weight++; } top.multiple++; if (top.multiple % 15 == 0) { instance = Instantiate(scorePrefab, new Vector3(cart.transform.position.x, cart.transform.position.y, center.z), Quaternion.identity); instance.transform.SetParent(canvas.transform, false); } if (SceneManager.GetActiveScene().buildIndex == 2 || SceneManager.GetActiveScene().buildIndex == 5 || SceneManager.GetActiveScene().buildIndex == 6) { if (this.gameObject.transform.parent.gameObject.name == "original") { if (top.multiple % 12 == 0) { Taptic.Light(); } } if (this.gameObject.transform.parent.gameObject.name == "cubestraight") { if (top.multiple % 7 == 0) { Taptic.Light(); } } if (this.gameObject.transform.parent.gameObject.name == "tiltedvertical") { if (top.multiple % 4 == 0) { Taptic.Light(); } } } else { if (this.gameObject.transform.parent.gameObject.name == "original") { if (top.multiple % 17 == 0) { Taptic.Light(); } } if (this.gameObject.transform.parent.gameObject.name == "cubestraight") { if (top.multiple % 12 == 0) { Taptic.Light(); } } if (this.gameObject.transform.parent.gameObject.name == "tiltedvertical") { if (top.multiple % 7 == 0) { Taptic.Light(); } } } } }
private void CheckSlotSelection() { if (GameManager.gameState == GameState.Level) { if (Selected)//Hold { foreach (Transform child in AllSlot.transform) { if (child.GetComponent <SlotObject>().Inside(transform.position)) { NearByInfo PreviousNearByInfo = CurrentNearByInfo; CurrentNearByInfo = child.GetComponent <SlotObject>().GetNearByInfo(); if (CurrentNearByInfo.Available()) { if (child.gameObject != SelectedSlot) //Select a new available slot { if (GameManager.CurrentConfig.Vibration) { Taptic.Light(); } ResetNearByBubble(PreviousNearByInfo); if (SelectedSlot != null) { SelectedSlot.GetComponent <SlotObject>().Selected = false; ResetOffsetInfo(); } child.GetComponent <SlotObject>().Selected = true; SelectedSlot = child.gameObject; if (SelectedSlot.GetComponent <SlotObject>().Type != SlotType.Teleport || !GameManager.ActivatedLevel.GetComponent <LevelManager>().TeleportAvailable(SelectedSlot.GetComponent <SlotObject>().ConnectedSlotInfo)) { ActivatedEffect.GetComponent <ParticleSystem>().Stop(); if (CurrentNearByInfo.RightBubble) { CurrentNearByInfo.RightBubble.GetComponent <NormalBubble>().IntendMoveDir = Direction.Right; ReleaseEffect.transform.Find("Right").GetComponent <ParticleSystem>().Play(); } else { ReleaseEffect.transform.Find("Right").GetComponent <ParticleSystem>().Stop(); } if (CurrentNearByInfo.LeftBubble) { CurrentNearByInfo.LeftBubble.GetComponent <NormalBubble>().IntendMoveDir = Direction.Left; ReleaseEffect.transform.Find("Left").GetComponent <ParticleSystem>().Play(); } else { ReleaseEffect.transform.Find("Left").GetComponent <ParticleSystem>().Stop(); } if (CurrentNearByInfo.TopBubble) { CurrentNearByInfo.TopBubble.GetComponent <NormalBubble>().IntendMoveDir = Direction.Up; ReleaseEffect.transform.Find("Up").GetComponent <ParticleSystem>().Play(); } else { ReleaseEffect.transform.Find("Up").GetComponent <ParticleSystem>().Stop(); } if (CurrentNearByInfo.DownBubble) { CurrentNearByInfo.DownBubble.GetComponent <NormalBubble>().IntendMoveDir = Direction.Down; ReleaseEffect.transform.Find("Down").GetComponent <ParticleSystem>().Play(); } else { ReleaseEffect.transform.Find("Down").GetComponent <ParticleSystem>().Stop(); } } else { ResetNearByBubble(CurrentNearByInfo); } } return; } } } if (SelectedSlot != null) // Not in available slot { SelectedSlot.GetComponent <SlotObject>().Selected = false; SelectedSlot = null; ResetOffsetInfo(); ActivatedEffect.GetComponent <ParticleSystem>().Play(); foreach (Transform Effect in ReleaseEffect.transform) { Effect.GetComponent <ParticleSystem>().Stop(); } ResetNearByBubble(CurrentNearByInfo); CurrentNearByInfo = null; } } else { if (SelectedSlot != null)//Release { SelectedSlot.GetComponent <SlotObject>().Selected = false; SelectedSlot = null; ResetOffsetInfo(); foreach (Transform Effect in ReleaseEffect.transform) { Effect.GetComponent <ParticleSystem>().Stop(); } ResetNearByBubble(CurrentNearByInfo); CurrentNearByInfo = null; } } } }