示例#1
0
    public override void OnTap(TapGesture gesutre)
    {
        if (!EnableTap)
        {
            return;
        }
        //Debug.Log(gesutre.Position);

        Ray ray = Camera.main.ScreenPointToRay(gesutre.Position);

        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 1000))
        {
            if (hit.collider.tag != AstarGridBase.GROUND)
            {
                return;
            }

            //Debug.Log(hit.point);
            var message = new Proto.Action_ClickMapGround
            {
                TargetPosition = hit.point.ToPVer3()
            };
            DoAction(message);
        }
    }
示例#2
0
    public override void OnTap(TapGesture gesutre)
    {
        var        ray = Camera.main.ScreenPointToRay(gesutre.Position);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 1000))
        {
            if (hit.collider.tag == AstarGridBase.GROUND)
            {
                var message = new Proto.Action_ClickMapGround
                {
                    TargetPosition = hit.point.ToPVer3()
                };
                SendAction(message);
            }
        }
    }