Пример #1
0
    public override void OnInspectorGUI()
    {
        VNetTransform me = (target as VNetTransform);

        GUIStyle style = new GUIStyle(GUI.skin.button);

        style.normal.textColor = Color.red;
        if (me.netIdentifier == 0 &&
            GUILayout.Button("Generate Net UID", style))
        {
            me.netIdentifier = VNetUtils.GenerateUIDInEditor();
        }

        if (me.isLocalControlled == false &&
            me.isRemoteControlled == false &&
            GUILayout.Button("Take Local Control"))
        {
            me.TakeLocalControl();
        }

        if (me.isLocalControlled &&
            GUILayout.Button("Revoke Local Control"))
        {
            me.RevokeLocalControl();
        }


        base.OnInspectorGUI();
    }
Пример #2
0
    public override void OnInspectorGUI()
    {
        VNetSpawnPrefab me = (target as VNetSpawnPrefab);

        GUIStyle style = new GUIStyle(GUI.skin.button);

        style.normal.textColor = Color.red;
        if (me.netIdentifier == 0 &&
            GUILayout.Button("Generate Net UID", style))
        {
            me.netIdentifier = VNetUtils.GenerateUIDInEditor();
        }

        base.OnInspectorGUI();
    }