private bool DrawSingleLine(int pos, string userId, LockResource resource)
        {
            float win = Screen.width * 0.6f;
            float w1  = win * 0.45f;
            float w2  = win * 0.15f;
            float w3  = win * 0.35f;

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(userId, GUILayout.Width(w2));
            EditorGUILayout.LabelField(resource.name, GUILayout.Width(w1));
            if (myUser == null)
            {
                return(false);
            }
            if (userId == myUser.UserId)
            {
                if (GUI.Button(new Rect(GUILayoutUtility.GetLastRect().position.x + 400, GUILayoutUtility.GetLastRect().position.y, 100, 20), "Remove Object"))
                {
                    if (resourceToBlock == null)
                    {
                        return(true);
                    }
                    LockResourcesOnlineManager.RemoveObjectToBlock(MyUser.UserId, resource);
                    return(false);
                }
            }
            EditorGUILayout.EndHorizontal();
            return(true);
        }
Example #2
0
 public void RemoveResource(LockResource resource)
 {
     lockedResources.Remove(lockedResources.Find(item => item.name == resource.name));
 }
Example #3
0
 public static void RemoveObjectToBlock(string userId, LockResource objectToBlock)
 {
     SearchUser(GetMachineIdByUserId(userId)).RemoveResource(objectToBlock);
     ObjectLocker.SetLocked(false, (GameObject)objectToBlock.resource);
     GenerateJson();
 }
Example #4
0
 public void AddResource(LockResource resource)
 {
     lockedResources.Add(new LockResource(resource.resource.name, ResourceType.GameObject, resource.resource));
 }
Example #5
0
 public static void AddObjectToBlock(string userId, LockResource objectToBlock)
 {
     SearchUser(GetMachineIdByUserId(userId)).AddResource(objectToBlock);
     GenerateJson();
 }