Example #1
0
        public override void Update()
        {
            if (InputEngine.IsMouseLeftClick())
            {
                PhysicsComponent.GameObjectInfo result;

                PhysicsEngine.CastRay(
                    GameUtilities.CreateRayFromVector2(InputEngine.MousePosition),
                    1000,
                    true,
                    out result);

                if (result != null)
                {
                    if (GameObjectSelected != null)
                    {
                        GameObjectSelected(result);
                    }
                }
            }

            base.Update();
        }