コード例 #1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        SlimNetClientProxy proxy = target as SlimNetClientProxy;

        if (proxy != null)
        {
            SlimNet.Unity.Client client = proxy.Instance;

            if (client != null)
            {
                EditorGUILayout.LabelField("Spatial Partitioner", client.Context.HasSpatialPartitioner ? client.Context.SpatialPartitioner.GetTypeName() : "<Null>");
            }
        }
    }
コード例 #2
0
    void Start()
    {
        if (saveBetweenScenes)
        {
            DontDestroyOnLoad(gameObject);
        }

        // Initialize log adapter
        Log.SetAdapter(new SlimNetConsole.LogAdapter());

        // Create client
        Instance = SlimNet.Unity.Client.Create();

        if (connectOnStart)
        {
            Connect(Host, Port);
        }
    }