public void SwitchPlayer() { Debug.Log("I switch"); Script_Player passenger = m_ActualPassenger; Script_Player driver = m_ActualDriver; m_ActualPassenger = driver; m_ActualDriver = passenger; m_ActualPassenger.BecomeDriver(); m_ActualDriver.BecomePassenger(); m_ActualDriver.transform.position = l_transform_switch_target[0].position; m_ActualPassenger.transform.position = l_transform_switch_target[1].position; }
void Start() { m_Car = GetComponent <CarController>(); int i = Random.Range(0, 2); if (i == 0) { m_ActualDriver = l_player[0]; m_ActualPassenger = l_player[1]; } else { m_ActualDriver = l_player[1]; m_ActualPassenger = l_player[0]; } m_ActualDriver.BecomeDriver(); m_ActualPassenger.BecomePassenger(); m_ActualDriver.transform.position = l_transform_switch_target[0].position; m_ActualPassenger.transform.position = l_transform_switch_target[1].position; }