Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 //Game States
 void Menu()
 {
     m_State = STATE.menu;
     if (onMenu != null)
     {
         onMenu.Invoke();
     }
 }
Exemplo n.º 3
0
 void Play()
 {
     m_State = STATE.play;
     if (onPlay != null)
     {
         onPlay.Invoke();
     }
 }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
 public void IncreaseCombo()
 {
     weaponHit.Invoke();
     currentComboNumber++;
 }