Esempio n. 1
0
 private void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         OnMouseDownEvent.Invoke(this, new MouseDownEventArgs("Hello!"));
     }
 }
Esempio n. 2
0
    private void OnMouseDown()
    {
        Vector2 mPos = Input.mousePosition;

        mPos = Camera.main.ScreenToWorldPoint(mPos);
        Vector2 dis = ((Vector2)rabbitCtrl.transform.position - mPos).normalized;

        rabbitCtrl.dir = Mathf.Abs(dis.x) > Mathf.Abs(dis.y) ? Vector2Int.left * System.Convert.ToInt32(dis.x) : Vector2Int.up * System.Convert.ToInt32(dis.y);
        downEvent.Invoke();
    }
Esempio n. 3
0
    void OnMouseDown()
    {
        //Debug.LogFormat("OnMouseDown");
        //Debug.LogFormat("OnMouseDown != null");
        onMouseDown?.Invoke(this);

        firstPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        tween         = transform.DOPath(
            new Vector3[] { transform.position,
                            new Vector3(transform.position.x,
                                        transform.position.y + 0.1f,
                                        transform.position.z), transform.position },
            .8f);
    }
Esempio n. 4
0
 void OnMouseDown()
 {
     onTrigger.Invoke(gameObject);
 }