protected void Update() { #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS) if (Input.touchCount > 0 && !m_isClick) { ClickBegin.Invoke(); m_isClick = true; } if (Input.touchCount <= 0) { ClickEnd.Invoke(); m_mouseStartPosition = Vector3.zero; m_inputs = Vector3.zero; m_isClick = false; } #endif #if UNITY_STANDALONE || UNITY_WEBGL || UNITY_EDITOR || UNITY_WEBPLAYER if (Input.GetMouseButton(0) && !m_isClick) { ClickBegin.Invoke(); m_isClick = true; } if (Input.GetMouseButtonUp(0)) { ClickEnd.Invoke(); m_mouseStartPosition = Vector3.zero; m_inputs = Vector3.zero; m_isClick = false; } #endif InputUpdate(); }
//Game States void Menu() { m_State = STATE.menu; if (onMenu != null) { onMenu.Invoke(); } }
void Play() { m_State = STATE.play; if (onPlay != null) { onPlay.Invoke(); } }
/// <summary> /// apply the damage to the game object wow belowed the script /// </summary> /// <param name="pDamage"> the amount of damage taken</param> protected virtual void Gethit(int pDamage) { if (pDamage <= 0) { return; } _currentLife -= pDamage; if (_currentLife <= 0) { if (DebugMode) { Debug.Log(name + ": death"); } isDead.Invoke(); return; } isHit.Invoke(_currentLife, _maxLife); }
public void IncreaseCombo() { weaponHit.Invoke(); currentComboNumber++; }