Ejemplo n.º 1
0
        private void Awake()
        {
            if (Instance != null && Instance != this)
            {
                DestroyImmediate(gameObject);
                return;
            }

            Instance = this;
            DontDestroyOnLoad(gameObject);

            Input.multiTouchEnabled = false;
            _mouseData = MouseDataClass.GetDefaultFromUpdate();
        }
Ejemplo n.º 2
0
 private void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         _mouseData = MouseDataClass.GetDefaultFromUpdate();
         OnMouseTouchedEvent?.Invoke(_mouseData);
     }
     if (Input.GetMouseButton(0))
     {
         OnMouseHoldEvent?.Invoke(_mouseData);
         _mouseData = new MouseDataClass(_mouseData, Input.mousePosition);
     }
     if (Input.GetMouseButtonUp(0))
     {
         OnMouseReleasedEvent?.Invoke(_mouseData);
         _mouseData = MouseDataClass.GetDefaultFromUpdate();
     }
 }