public void OnGUI(ImpactProxyConfig.Foldout foldout, string foldoutName, List <Proxy> proxies, List <int> poolOfCharacterGroupId, List <int> poolOfWeaponVisualId, List <string> poolOfWeaponName) { bool isFoldout = DrawProxyName(foldout, foldoutName, proxies); if (!isFoldout) { return; } DrawDefaultPrefab(); DrawCharacterIdAndPrefabs( poolOfCharacterGroupId, poolOfWeaponVisualId, poolOfWeaponName ); }
private bool DrawProxyName(ImpactProxyConfig.Foldout foldout, string foldoutName, List <Proxy> proxies) { if (proxyId == -1) { proxyId = proxies[0].id; } int index = -1; for (int i = 0; i < proxies.Count; i++) { if (proxies[i].id == proxyId) { index = i; } } if (!foldout.foldoutByPath.ContainsKey(foldoutName)) { foldout.foldoutByPath[foldoutName] = true; } bool isFoldout = foldout.foldoutByPath[foldoutName]; using (new EditorHelper.Horizontal()) { GUIStyle gs = new GUIStyle(EditorStyles.foldout); gs.stretchWidth = false; gs.fixedWidth = 75; isFoldout = EditorGUILayout.Foldout(isFoldout, "Proxy", true, gs); foldout.foldoutByPath[foldoutName] = isFoldout; index = EditorGUILayout.Popup( "", index, proxies.Select(proxy => proxy.name).ToArray(), GUILayout.ExpandWidth(false), GUILayout.Width(256) ); if (EditorHelper.MiniButton("-")) { isRemoved = true; } } proxyId = proxies[index].id; return(isFoldout); }