Ejemplo n.º 1
0
    public virtual void Update()
    {
        if (client == null)
        {
            client = GameObject.FindObjectOfType <ScapeNet_Client>();
        }

        if (server == null)
        {
            server = GameObject.FindObjectOfType <ScapeNet_Server>();
        }

        if (client.enabled == true)
        {
            if (!isConnected)
            {
                if (client.IsClientConnected())
                {
                    OnNetworkConnect();
                    isConnected = true;
                }
            }
        }

        if (server.enabled == true && hasServerStarted == false)
        {
            OnServerStart();
            hasServerStarted = true;
        }
    }
Ejemplo n.º 2
0
    public virtual void Start()
    {
        isServer = GameObject.FindObjectOfType <ScapeNet_Identifier>().isServer;
        isClient = GameObject.FindObjectOfType <ScapeNet_Identifier>().isClient;

        client = GameObject.FindObjectOfType <ScapeNet_Client>();
        server = GameObject.FindObjectOfType <ScapeNet_Server>();
    }
Ejemplo n.º 3
0
    void Awake()
    {
        identififer = GameObject.FindObjectOfType <ScapeNet_Identifier>();
        settings    = GameObject.FindObjectOfType <ScapeNet_Settings>();

        client = GameObject.FindObjectOfType <ScapeNet_Client>();
        server = GameObject.FindObjectOfType <ScapeNet_Server>();
    }