private void UseActive(Vector3 position, ActiveSkillsEnum activeType) { //GUIController.Instance.CurrentActive.gameObject.SetActive(false); GameController.Instance.Light.ActiveOn = false; switch (activeType) { case ActiveSkillsEnum.Buoy: GameController.Instance.GetBuoy(position); StartCoroutine(BuoyCD()); break; case ActiveSkillsEnum.Flare: GameController.Instance.GetFlare(position); StartCoroutine(FlareCD()); break; case ActiveSkillsEnum.Freeze: OnFreeze(); StartCoroutine(FreezeCD()); break; case ActiveSkillsEnum.SecondLight: OnSecondLight(); StartCoroutine(SecondCD()); break; } }
public void UpdateActiveGUI(ActiveSkillsEnum type, float progres) { int index = (int)type; if (index >= 0 && index < _activeSkillsGUIInfoCount) { _activeSkillGUIInfos[index].UpdateActive(progres); } }
public void ShowSkillScreen(ActiveSkillsEnum type) { ActiveButtons.SetActive(false); _hideActiveSkillsButton.SetActive(false); int index = (int)type; if (index >= 0 && index < _activeSkillsGUIInfoCount) { _activeSkillScreen.gameObject.SetActive(true); _activeSkillScreen.color = _activeSkillGUIInfos[index].defaultBackgroundColor; } }
private void PlaceActive(ActiveSkillsEnum type, Vector3 position) { position.z = 0.0f; switch (type) { case ActiveSkillsEnum.Buoy: GameController.Instance.GetBuoy(position); break; case ActiveSkillsEnum.Flare: GameController.Instance.GetFlare(position); break; } _activeInfos[(int)CurrentActive].timer = 0.0f; GUIController.Instance.HideActiveSkills(); CurrentActive = ActiveSkillsEnum.NONE; }
public void ProcessInput() { if (GameLord.Instance.CurrentGameState == GameLord.GameState.GS_GAME && InputManager.Instance.ThisFrameTouch && CurrentActive != ActiveSkillsEnum.NONE && !GameController.Instance.Light.Targeted) { Ray ray = GameController.Instance.MainCamera.ScreenPointToRay(InputManager.Instance.TouchPosition); UseActive(ray.origin, CurrentActive); CurrentActive = ActiveSkillsEnum.NONE; } else { if (GameLord.Instance.CurrentGameState == GameLord.GameState.GS_GAME) { GameController.Instance.Light.ActiveOn = false; } if (InputManager.Instance.PreviousFrameTouch) { CurrentActive = ActiveSkillsEnum.NONE; } } }
public void ActivateSkill(ActiveSkillsEnum type) { GUILord.ButtonSound(); int index = (int)type; if (index >= 0 && index < _activeInfoCount) { if (_activeInfos[index].unlocked && _activeInfos[index].Availible) { _activeInfos[index].Activate(); if (_activeInfos[index].showSkillScreen) { GUIController.Instance.ShowSkillScreen(_activeInfos[index].activeType); CurrentActive = _activeInfos[index].activeType; } else { GUIController.Instance.HideActiveSkills(); } } } }