Beispiel #1
0
 private void OnMouseUp()
 {
     upEvent?.Invoke();
     Debug.Log("up event invoked");
 }
Beispiel #2
0
 private void OnCompleteClose()
 {
     onClose?.Invoke();
     container.SetActive(false);
     gameObject.SetActive(false);
 }
Beispiel #3
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     onInteraction?.Invoke();
 }
        public override void CheckOverlap()
        {
            if (!m_arrCondition.PassAllCondition(eventConditionData))
            {
                return;
            }



            Vector2 vPos = m_hOverlapPosition != null ? m_hOverlapPosition.position : transform.position;
            float   fAngle;

            if (m_bUseLocalAngle)
            {
                fAngle = m_hOverlapPosition != null ? m_hOverlapPosition.localEulerAngles.z : transform.localEulerAngles.z;
            }
            else
            {
                fAngle = m_hOverlapPosition != null ? m_hOverlapPosition.eulerAngles.z : transform.eulerAngles.z;
            }


            int nHit = Physics2D.OverlapBoxNonAlloc(vPos, m_vSize, fAngle, hitColArray, m_eTargetLayer);

            if (nHit <= 0)
            {
                m_hNotHitEvent?.Invoke();
                return;
            }

            bool bHit       = false;
            int  nSendCount = 0;

            for (int i = 0; i < nHit; i++)
            {
                var hHitGO = m_arrHitCol[i].gameObject;
                if (CheckNotIgnoreTarget(hHitGO))
                {
                    // Check hit GameObject is target tag.
                    if (m_arrTargetTag.HasData() && !hHitGO.CompareTag(m_arrTargetTag))
                    {
                        continue;
                    }

                    if (!bHit)
                    {
                        m_hHitEvent?.Invoke();
                    }

                    bHit = true;

                    m_hHitEventGameObject?.Invoke(hHitGO);
                    nSendCount++;

                    if (nSendCount >= m_nMaxSendData)
                    {
                        break;
                    }
                }
            }

            if (!bHit)
            {
                m_hNotHitEvent?.Invoke();
            }
        }
Beispiel #5
0
 public void Exit()
 {
     onExit?.Invoke();
 }
 public void OnPointerClick(PointerEventData eventData)
 {
     Focus();
     _OnPointerClick?.Invoke();
 }
Beispiel #7
0
 // Update is called once per frame
 void Update()
 {
     update?.Invoke();
 }
 public void OnNotified(bool value) =>
 notifierEventResonse?.Invoke(value);
 private void Respond()
 {
     onEventRaised?.Invoke();
 }
Beispiel #10
0
 public void GameOver()
 {
     OnLevelLost?.Invoke();
 }
 private void OnDisable()
 {
     Disabled?.Invoke();
 }
Beispiel #12
0
 private void Start()
 {
     OnLevelStart?.Invoke();
 }
    public void InputPass()
    {
        // Get Input
        float y = 0;
        float x = 0;

        if (_useAxis)
        {
            y = Input.GetAxisRaw("Horizontal");
            x = Input.GetAxisRaw("Vertical");
        }
        else
        {
            if (Input.GetButtonDown("Fire_A"))
            {
                x--;
            }
            if (Input.GetButtonDown("Fire_B"))
            {
                y++;
            }
            if (Input.GetButtonDown("Fire_X"))
            {
                y--;
            }
            if (Input.GetButtonDown("Fire_Y"))
            {
                x++;
            }
        }

        if (_lastX != x || _lastY != y)
        {
            // Debug.Log($"x : {x} - y : {y}");
            _lastY = y;
            _lastX = x;
        }

        // Check Up
        if (!_validated[(int)VirtualNote.Up] && x > _validationThreshold)
        {
            _validated[(int)VirtualNote.Up] = true;
            OnUp?.Invoke();
            OnHammerHit?.Invoke();
            OnUpUnity?.Invoke();
            // Debug.Log("Up");
        }
        if (!_validated[(int)VirtualNote.Right] && y > _validationThreshold)
        {
            _validated[(int)VirtualNote.Right] = true;
            OnRight?.Invoke();
            OnHammerHit?.Invoke();
            OnRightUnity?.Invoke();
            // Debug.Log("Right");
        }
        if (!_validated[(int)VirtualNote.Down] && x < _validationThreshold * -1)
        {
            _validated[(int)VirtualNote.Down] = true;
            OnDown?.Invoke();
            OnHammerHit?.Invoke();
            OnDownUnity?.Invoke();
            // Debug.Log("Down");
        }
        if (!_validated[(int)VirtualNote.Left] && y < _validationThreshold * -1)
        {
            _validated[(int)VirtualNote.Left] = true;
            OnLeft?.Invoke();
            OnHammerHit?.Invoke();
            OnLeftUnity?.Invoke();
            // Debug.Log("Left");
        }

        // Check disabled
        if ((_validated[(int)VirtualNote.Up] || _validated[(int)VirtualNote.Down]) && Mathf.Abs(x) <= _disableThreshold)
        {
            _validated[(int)VirtualNote.Up]   = false;
            _validated[(int)VirtualNote.Down] = false;
        }
        if ((_validated[(int)VirtualNote.Right] || _validated[(int)VirtualNote.Left]) && Mathf.Abs(y) <= _disableThreshold)
        {
            _validated[(int)VirtualNote.Right] = false;
            _validated[(int)VirtualNote.Left]  = false;
        }
    }
Beispiel #14
0
 void CallEvent()
 {
     onTimeUp?.Invoke();
 }
 public void OnPointerUp(PointerEventData eventData)
 {
     pressed = false;
     OnRepeatClickEnd?.Invoke();
 }
Beispiel #16
0
 public override void OnEnter()
 {
     _onEnter?.Invoke();
 }
Beispiel #17
0
 void OnValidate()
 {
     Changed?.Invoke();
 }
Beispiel #18
0
 public override void OnExit()
 {
     _onExit?.Invoke();
 }
Beispiel #19
0
 // Start is called before the first frame update
 void Start()
 {
     start?.Invoke();
 }
Beispiel #20
0
 public void Die()
 {
     isDead = true;
     onDead?.Invoke();
     OnDead?.Invoke();
 }
Beispiel #21
0
 void OnDestroy()
 {
     destroy?.Invoke();
 }
Beispiel #22
0
 private void OnDestroy()
 {
     onDestroy?.Invoke();
 }
Beispiel #23
0
 public void Enter()
 {
     onEnter?.Invoke();
 }
 public void OnInvoke()
 {
     response?.Invoke();
 }
Beispiel #25
0
 public void Die()
 {
     onDeath?.Invoke();
 }
Beispiel #26
0
 public virtual void Excecute()
 {
     e?.Invoke();
 }
Beispiel #27
0
 //Deactivation
 public void StartDeactivation()
 {
     OnStartDeactivation?.Invoke();
     StartCoroutine(WaitForDeactivation());
 }
 public void OnPointerDown(PointerEventData eventData)
 {
     pressed = true;
     OnRepeatClickStart?.Invoke();
 }
Beispiel #29
0
 private void OnTriggerEnter(Collider other)
 {
     triggerEnter?.Invoke();
 }
Beispiel #30
0
 void OnMouseDown()
 {
     Debug.Log("clicked");
     _anim.Play("onclick");
     downEvent?.Invoke();
 }