Exemple #1
0
        // process input
        public bool ProcessInput()
        {
            // if up
            if (JInputManager.ButtonUp(0))
            {
                Vector2      wp  = Camera.main.ScreenToWorldPoint(JInputManager.GetScreenPosition(0));
                Ray2D        ray = new Ray2D(wp, Vector2.zero);
                RaycastHit2D hit = Physics2D.Raycast(ray.origin, ray.direction);

                if (hit.collider != null)
                {
                    SetSelectedObject(hit.collider.gameObject);
                }

                return(true);
            }

            return(false);
        }