Exemplo n.º 1
0
    public void CheckCars()
    {
        for (int i = 0; i < PlayerCarInformations.Length; i++)
        {
            PlayerCarInformations[i] = null;
        }

        int StatsIndex = 0;

        if (!PlayerCarContainer)
        {
            PlayerCarContainer = GameObject.FindGameObjectWithTag("PlayerTagContainer");
        }

        for (int i = 0; i < PlayerCarContainer.transform.childCount; i++)
        {
            GameObject Temp       = PlayerCarContainer.transform.GetChild(i).gameObject;
            CarButton  CarToCheck = Temp.GetComponent <CarButton>();

            if (CarToCheck && CarToCheck.AssignedDropPoint)
            {
                PlayerCarInformations[DropPoints.IndexOf(CarToCheck.AssignedDropPoint)] = CarToCheck;
                PlayerCarsStats[StatsIndex].Acceleration = CarToCheck.CarInfo.Acceleration;
                PlayerCarsStats[StatsIndex].CarImage     = CarToCheck.CarInfo.CarImage;
                PlayerCarsStats[StatsIndex].Drive        = CarToCheck.CarInfo.Drive;
                PlayerCarsStats[StatsIndex].Handling     = CarToCheck.CarInfo.Handling;
                PlayerCarsStats[StatsIndex].TopSpeed     = CarToCheck.CarInfo.TopSpeed;
                PlayerCarsStats[StatsIndex].Tyres        = CarToCheck.CarInfo.Tyres;
                StatsIndex++;
            }
        }


        bool bShowStartButton = false;

        for (int i = 0; i < PlayerCarInformations.Length; i++)
        {
            if (PlayerCarInformations[i] != null)
            {
                bShowStartButton = true;
            }
            else
            {
                bShowStartButton = false;
                break;
            }
        }

        if (bShowStartButton)
        {
            StartRacesButton.gameObject.SetActive(true);
        }
        else
        {
            StartRacesButton.gameObject.SetActive(false);
        }
    }
Exemplo n.º 2
0
        void ReleaseDesignerOutlets()
        {
            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (CanvelView != null)
            {
                CanvelView.Dispose();
                CanvelView = null;
            }

            if (CarButton != null)
            {
                CarButton.Dispose();
                CarButton = null;
            }

            if (CategoriasCollectionView != null)
            {
                CategoriasCollectionView.Dispose();
                CategoriasCollectionView = null;
            }

            if (OptionsView != null)
            {
                OptionsView.Dispose();
                OptionsView = null;
            }

            if (SearchTableView != null)
            {
                SearchTableView.Dispose();
                SearchTableView = null;
            }

            if (SearchTextField != null)
            {
                SearchTextField.Dispose();
                SearchTextField = null;
            }

            if (UserButton != null)
            {
                UserButton.Dispose();
                UserButton = null;
            }
        }
Exemplo n.º 3
0
        public override bool DispatchTouchEvent(MotionEvent e)
        {
            CarButton target = (CarButton)Element;

            switch (e.Action)
            {
            case MotionEventActions.Down:
                target.RaiseTouched(true);
                break;

            case MotionEventActions.Up:
                target.RaiseTouched(false);
                break;
            }
            return(true);
        }