Example #1
0
        override public void OnInspectorGUI()
        {
            GameObject net_mgr_obj = GameObject.Find("NetworkManager");

            Toxic.NetworkManager net_mgr = (net_mgr_obj != null) ? net_mgr_obj.GetComponent <Toxic.NetworkManager>() : null;

            // If we find the network manager, display the list of spawnable objects
            if (net_mgr)
            {
                // Otherwise just let the user manually punch in spawn indices
            }
            else
            {
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
            }
        }
Example #2
0
        void Start()
        {
            GameObject net_mgr = GameObject.Find("NetworkManager");

            if (!net_mgr)
            {
                Debug.LogError("Could not find global GameObject with name 'NetworkManager'.");
                return;
            }

            _net_mgr = net_mgr.GetComponent <Toxic.NetworkManager>();

            if (!_net_mgr)
            {
                Debug.LogError("Could not find a 'Toxic.NetworkManager' on global GameObject 'NetworkManager'.");
            }

            if (useSeedForRNG)
            {
                rng = new System.Random(seed);
            }
        }
        // Internal Unity handling API
        void Start()
        {
            DontDestroyOnLoad(this);

            GameObject net_mgr = GameObject.Find("NetworkManager");

            if (!net_mgr)
            {
                Debug.LogError("Could not find global GameObject with name 'NetworkManager'.");
                return;
            }

            _net_mgr = net_mgr.GetComponent <Toxic.NetworkManager>();

            if (!_net_mgr)
            {
                Debug.LogError("Could not find a 'Toxic.NetworkManager' on global GameObject 'NetworkManager'.");
                return;
            }

            _net_mgr.ServerStarted += OnServerStart;
            _net_mgr.ClientStarted += OnClientStart;
            _net_mgr.HostStarted   += OnHostStart;
        }
        // Internal Unity handling API
        void Start()
        {
            DontDestroyOnLoad(this);

            GameObject net_mgr = GameObject.Find("NetworkManager");

            if (!net_mgr) {
            Debug.LogError("Could not find global GameObject with name 'NetworkManager'.");
            return;
            }

            _net_mgr = net_mgr.GetComponent<Toxic.NetworkManager>();

            if (!_net_mgr) {
            Debug.LogError("Could not find a 'Toxic.NetworkManager' on global GameObject 'NetworkManager'.");
            return;
            }

            _net_mgr.ServerStarted += OnServerStart;
            _net_mgr.ClientStarted += OnClientStart;
            _net_mgr.HostStarted += OnHostStart;
        }
Example #5
0
        void Start()
        {
            GameObject net_mgr = GameObject.Find("NetworkManager");

            if (!net_mgr) {
            Debug.LogError("Could not find global GameObject with name 'NetworkManager'.");
            return;
            }

            _net_mgr = net_mgr.GetComponent<Toxic.NetworkManager>();

            if (!_net_mgr) {
            Debug.LogError("Could not find a 'Toxic.NetworkManager' on global GameObject 'NetworkManager'.");
            }

            if (useSeedForRNG) {
            rng = new System.Random(seed);
            }
        }