Ejemplo n.º 1
0
 private void Awake()
 {
     m_PlayerInfo          = GetComponent <PlayerInfo>();
     m_PlayerController    = GetComponent <PlayerController>();
     m_NetworkManager      = FindObjectOfType <PolePositionNetworkManager>();
     m_PolePositionManager = FindObjectOfType <PolePositionManager>();
     m_UIManager           = FindObjectOfType <UIManager>();
     m_NameController      = GetComponent <NameController>();
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     // Se buscan las referencias del PolePositionNetworkManager y del PolePositionManager
     if (m_NetworkManager == null)
     {
         m_NetworkManager = FindObjectOfType <PolePositionNetworkManager>();
     }
     if (m_PolePositionManager == null)
     {
         m_PolePositionManager = FindObjectOfType <PolePositionManager>();
     }
 }
Ejemplo n.º 3
0
    private void Awake()
    {
        if (networkManager == null)
        {
            networkManager = FindObjectOfType <PolePositionNetworkManager>();
        }
        if (uiManager == null)
        {
            uiManager = FindObjectOfType <UIManager>();
        }
        if (m_CircuitController == null)
        {
            m_CircuitController = FindObjectOfType <CircuitController>();
        }

        //Delegados UI
        OnOrderChangeDelegate    += uiManager.ChangeOrder;
        OnOrderChangeDelegate    += uiManager.ChangeOrderServer;
        OnCountDownDelegate      += uiManager.CountDown;
        OnUpdateLapDelegate      += uiManager.UpdateLap;
        OnWrongDirectionDelegate += uiManager.WrongDirection;
        OnLapTimeDelegate        += uiManager.UpdateTimeLap;

        m_DebuggingSpheres = new GameObject[networkManager.maxConnections];
        for (int i = 0; i < networkManager.maxConnections; ++i)
        {
            m_DebuggingSpheres[i] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
            m_DebuggingSpheres[i].GetComponent <SphereCollider>().enabled = false;
            m_DebuggingSpheres[i].GetComponent <MeshRenderer>().enabled   = false;
        }
        for (int i = 0; i < playersConnected.Length; i++)
        {
            playersConnected[i] = false;
        }
        gameStarted = false;
    }