コード例 #1
0
        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);
        }
コード例 #2
0
 public void RemoveResource(LockResource resource)
 {
     lockedResources.Remove(lockedResources.Find(item => item.name == resource.name));
 }
コード例 #3
0
 public static void RemoveObjectToBlock(string userId, LockResource objectToBlock)
 {
     SearchUser(GetMachineIdByUserId(userId)).RemoveResource(objectToBlock);
     ObjectLocker.SetLocked(false, (GameObject)objectToBlock.resource);
     GenerateJson();
 }
コード例 #4
0
 public void AddResource(LockResource resource)
 {
     lockedResources.Add(new LockResource(resource.resource.name, ResourceType.GameObject, resource.resource));
 }
コード例 #5
0
 public static void AddObjectToBlock(string userId, LockResource objectToBlock)
 {
     SearchUser(GetMachineIdByUserId(userId)).AddResource(objectToBlock);
     GenerateJson();
 }