Ejemplo n.º 1
0
        private void Mouse_LeftClicked(object sender, EventArgs e)
        {
            if (shape.GetGlobalBounds().Intersects(Game.Input.Mouse.Position))
            {
                Game.AudioPlayer.PlaySound("GUI_CLICK");

                if (boxChecked)
                {
                    boxChecked = false;
                    UnCheckedEvent?.Invoke(this, null);
                }
                else
                {
                    boxChecked = true;
                    CheckedEvent?.Invoke(this, null);
                }
            }
        }
Ejemplo n.º 2
0
    void OnTriggerEnter(Collider other)
    {
        WheelVehicle v = other.GetComponentInParent <WheelVehicle>();

        if (v != null && other.gameObject.CompareTag("Player") && !_checked.ContainsKey(v))
        {
            _sprite.color = _passedColor;

            _checked[v] = true;

            _checkedEvent.Invoke(v);

            if (_isStart)
            {
                GameManager.instance.StartRace(v);
            }

            if (_isFinish)
            {
                GameManager.instance.FinishRace(v);
            }
        }
    }