private void HandleActionGhostCarLoaded(GameObject obj)
    {
        Debug.Log("[GhostController] HandleActionGhostCarLoaded");
        try{
            ghostRacer = obj.GetComponent <RS_DragCarController>();
            ghostRacer.gameObject.layer = LayerMask.NameToLayer("Ghost");

            PlayerSpawnPoint spawnPoint = GameObject.FindObjectOfType <PlayerSpawnPoint>();
            ghostRacer.transform.position = new Vector3(spawnPoint.transform.position.x - 4.8f, spawnPoint.transform.position.y, spawnPoint.transform.position.z);

            if (RS_GamePlayController.Mode == RS_GameMode.Multiplayer)
            {
                UM_TBM_Participant compet = RS_GamePlayController.Instance.Multiplayer.CurrentMatch.Competitor;
                if (compet != null)
                {
                    Debug.Log("[Compete With Other Palayer] Name:" + compet.DisplayName);
                }
                else
                {
                    Debug.Log("[I'm The Creator!!!]");
                }
            }
            else
            {
                Debug.Log("[Singleplayer Mode activated! Your data will be saved locally]");
            }
        } catch (Exception ex) {
            Debug.LogError("HandleActionGhostBikeLoaded - " + ex.Message);
        }
    }
Beispiel #2
0
    private void SetValues(RS_DragCarController car)
    {
        if (car != null)
        {
            SpeedValue.text = ((int)car.Speed).ToString();

            if (car.CurrentGear == 0)
            {
                GearValue.text = "N";
            }
            else
            {
                GearValue.text = ((int)car.CurrentGear).ToString();
            }


            SetRMP((int)car.CurrnetRPM);
        }
    }
    void RS_CarFactory_CarLoadedAction(GameObject car)
    {
        RS_CarFactory.CarLoadedAction -= RS_CarFactory_CarLoadedAction;
        PlayerSpawnPoint spawnPoint  = GameObject.FindObjectOfType <PlayerSpawnPoint>();
        TrackFinishPoint finishPoint = GameObject.FindObjectOfType <TrackFinishPoint> ();

        finishPoint.OnPointTriggered += delegate() {
            OnLevelFinishedAction();
            Debug.Log("!!!Drag Race Fuinished!!!");

            UIController.ButtonGoToMainMenuEvent += UIController_ButtonGoToMainMenuEvent;

            if (Mode == RS_GameMode.SinglePlayer)
            {
                UIController.ShowForSingleplayer(UM_GameServiceManager.Instance.Player,
                                                 _ghost.IsNewRecord(),
                                                 _ghost.GetCurrentTime(),
                                                 _ghost.SavedDataExists(),
                                                 _ghost.GetCurrentTime() - _ghost.GetRecordTime());
            }
            else
            {
                foreach (UM_TBM_Match match in TBM.Matchmaker.Matches)                   //Just shitty lines of code. Refactor needed
                {
                    if (match.Id.Equals(ActiveMatch.Id))
                    {
                        UIController.ShowForMultiplayer(match, _ghost.GetCurrentTime());
                    }
                }
            }
        };

        _player = car.GetComponent <RS_DragCarController>();
        _player.transform.position = spawnPoint.transform.position;

        SetupCar();
        OnPlayerSpawned();
    }
Beispiel #4
0
 public void AttachCar(RS_DragCarController car)
 {
     _AttachedCar = car;
 }
    //--------------------------------------
    // Public Methods
    //--------------------------------------

    public void SetupUI(RS_DragCarController car)
    {
        Dashboard.gameObject.SetActive(true);
        TopPanel.gameObject.SetActive(true);
        Dashboard.AttachCar(car);
    }
Beispiel #6
0
 void Awake()
 {
     _Car = GetComponent <RS_DragCarController>();
 }