Unity 自定义检查器和子检查器

2024-04-26

我正在Unity 2017.2 中开发一个小型ARPG。

我尝试为我的游戏的能力蓝图类实现自定义编辑器。

基本上,AbilityBluePrint 包含在运行时生成能力所需的所有信息。包括一个 Effect[] ScritpableObjects 数组,当使用该能力时会触发该数组。

我目前已经拥有了需要实施和工作的一切,但我认为创建能力会非常乏味,原因如下。

假设我有一个效果类 DamagePlusX : Effect 作为伤害修正值。如果我希望此效果对两种不同的能力具有不同的修饰符值,那么我必须在资源目录中创建它的两个实例,并手动将每个实例分配给相应能力的 Effect[] 数组。我担心我最终会得到很多很多效果实例,每个效果实例本质上都有一些不同的整数和浮点数。

因此,我想我会使用一个有点像来自的自定义检查器冒险教程 https://unity3d.com/learn/tutorials/projects/adventure-game-tutorial/reactions?playlist=44381来自统一。

这个想法基本上是创建AbilityBluePrint的实例,然后使用自定义检查器能够动态实例化Effects[]数组中的效果,并能够直接在AbilityBluePrint检查器中编辑每个效果的属性。

基本上我想要得到一些类似的东西(为可怜的Photoshop道歉):

我尝试转换教程中的脚本以满足我的需要,但从昨天开始我一直遇到同样的错误:

NullReferenceException: Object reference not set to an instance of an object
AbilityBluePrintEditor.SubEditorSetup (.EffectEditor editor) (at Assets/Scripts/Editor/AbilityBluePrintEditor.cs:90)
EditorWithSubEditors`2[TEditor,TTarget].CheckAndCreateSubEditors (.TTarget[] subEditorTargets) (at Assets/Scripts/Editor/EditorWithSubEditors.cs:33)

我尝试了很多事情,我想知道我想做的事情是否可以使用可编写脚本的对象来实现。在原始教程中,我的 BluePrintAbility 的等效项是 Monobehaviour。

我的代码如下:

我的 BluePrintAbility 课程:

[CreateAssetMenu(fileName = "New Ability BluePrint", menuName = "Ability BluePrint")]
public class AbilityBluePrint : ScriptableObject {
    public Effect[] effects = new Effect[0];
    public string description;
}

我的效果类:

public abstract class Effect : ScriptableObject {
    }

我的 DamagePlusX 效果等级:

[CreateAssetMenu(fileName = "DamagePlusX",menuName = "Effects/DamagePlusX")]
public class DamagePlusX : Effect
{
    [SerializeField]
    int modifier;

    public void ApplyModifier(){ // some logic}
}

现在编辑们(对长样本表示歉意,但我现在不知道错误在哪里,不过我已经减少了主要类):

这是教程中的基本编辑器,我的错误来自于此:

// This class acts as a base class for Editors that have Editors
// nested within them.  For example, the InteractableEditor has
// an array of ConditionCollectionEditors.
// It's generic types represent the type of Editor array that are
// nested within this Editor and the target type of those Editors.
public abstract class EditorWithSubEditors<TEditor, TTarget> : Editor
    where TEditor : Editor
    where TTarget : Object

{
    protected TEditor[] subEditors;         // Array of Editors nested within this Editor.


// This should be called in OnEnable and at the start of OnInspectorGUI.
protected void CheckAndCreateSubEditors (TTarget[] subEditorTargets)
{
    // If there are the correct number of subEditors then do nothing.
    if (subEditors != null && subEditors.Length == subEditorTargets.Length)
        return;

    // Otherwise get rid of the editors.
    CleanupEditors ();

    // Create an array of the subEditor type that is the right length for the targets.
    subEditors = new TEditor[subEditorTargets.Length];

    // Populate the array and setup each Editor.
    for (int i = 0; i < subEditors.Length; i++)
    {
        subEditors[i] = CreateEditor (subEditorTargets[i]) as TEditor;
        SubEditorSetup (subEditors[i]); // ERROR comes inside this function HERE !!!!
    }
}


// This should be called in OnDisable.
protected void CleanupEditors ()
{
    // If there are no subEditors do nothing.
    if (subEditors == null)
        return;

    // Otherwise destroy all the subEditors.
    for (int i = 0; i < subEditors.Length; i++)
    {
        DestroyImmediate (subEditors[i]);
    }

    // Null the array so it's GCed.
    subEditors = null;
}


// This must be overridden to provide any setup the subEditor needs when it is first created.
protected abstract void SubEditorSetup (TEditor editor);

}

    [CustomEditor(typeof(AbilityBluePrint)), CanEditMultipleObjects]
public class AbilityBluePrintEditor : EditorWithSubEditors<EffectEditor, Effect>
{
    private AbilityBluePrint blueprint;          // Reference to the target.
    private SerializedProperty effectsProperty; //represents the array of effects.

    private Type[] effectTypes;                           // All the non-abstract types which inherit from Effect.  This is used for adding new Effects.
    private string[] effectTypeNames;                     // The names of all appropriate Effect types.
    private int selectedIndex;                              // The index of the currently selected Effect type.


    private const float dropAreaHeight = 50f;               // Height in pixels of the area for dropping scripts.
    private const float controlSpacing = 5f;                // Width in pixels between the popup type selection and drop area.
    private const string effectsPropName = "effects";   // Name of the field for the array of Effects.


    private readonly float verticalSpacing = EditorGUIUtility.standardVerticalSpacing;
    // Caching the vertical spacing between GUI elements.

    private void OnEnable()
    {
        // Cache the target.
        blueprint = (AbilityBluePrint)target;

        // Cache the SerializedProperty
        effectsProperty = serializedObject.FindProperty(effectsPropName);

        // If new editors for Effects are required, create them.
        CheckAndCreateSubEditors(blueprint.effects);

        // Set the array of types and type names of subtypes of Reaction.
        SetEffectNamesArray();
    }

    public override void OnInspectorGUI()
    {
        // Pull all the information from the target into the serializedObject.
        serializedObject.Update();

        // If new editors for Reactions are required, create them.
        CheckAndCreateSubEditors(blueprint.effects);

        DrawDefaultInspector();

        // Display all the Effects.
        for (int i = 0; i < subEditors.Length; i++)
        {
            if (subEditors[i] != null)
            {
                subEditors[i].OnInspectorGUI();
            }            
        }

        // If there are Effects, add a space.
        if (blueprint.effects.Length > 0)
        {
            EditorGUILayout.Space();
            EditorGUILayout.Space();
        }


        //Shows the effect selection GUI
        SelectionGUI();

        if (GUILayout.Button("Add Effect"))
        {

        }

        // Push data back from the serializedObject to the target.
        serializedObject.ApplyModifiedProperties();
    }

    private void OnDisable()
    {
        // Destroy all the subeditors.
        CleanupEditors();
    }

    // This is called immediately after each ReactionEditor is created.
    protected override void SubEditorSetup(EffectEditor editor)
    {
        // Make sure the ReactionEditors have a reference to the array that contains their targets.
        editor.effectsProperty = effectsProperty; //ERROR IS HERE !!!
    }

    private void SetEffectNamesArray()
    {
        // Store the Effect type.
        Type effectType = typeof(Effect);

        // Get all the types that are in the same Assembly (all the runtime scripts) as the Effect type.
        Type[] allTypes = effectType.Assembly.GetTypes();

        // Create an empty list to store all the types that are subtypes of Effect.
        List<Type> effectSubTypeList = new List<Type>();

        // Go through all the types in the Assembly...
        for (int i = 0; i < allTypes.Length; i++)
        {
            // ... and if they are a non-abstract subclass of Effect then add them to the list.
            if (allTypes[i].IsSubclassOf(effectType) && !allTypes[i].IsAbstract)
            {
                effectSubTypeList.Add(allTypes[i]);
            }
        }

        // Convert the list to an array and store it.
        effectTypes = effectSubTypeList.ToArray();

        // Create an empty list of strings to store the names of the Effect types.
        List<string> reactionTypeNameList = new List<string>();

        // Go through all the Effect types and add their names to the list.
        for (int i = 0; i < effectTypes.Length; i++)
        {
            reactionTypeNameList.Add(effectTypes[i].Name);
        }

        // Convert the list to an array and store it.
        effectTypeNames = reactionTypeNameList.ToArray();
    }

    private void SelectionGUI()
    {
        // Create a Rect for the full width of the inspector with enough height for the drop area.
        Rect fullWidthRect = GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, GUILayout.Height(dropAreaHeight + verticalSpacing));

        // Create a Rect for the left GUI controls.
        Rect leftAreaRect = fullWidthRect;

        // It should be in half a space from the top.
        leftAreaRect.y += verticalSpacing * 0.5f;

        // The width should be slightly less than half the width of the inspector.
        leftAreaRect.width *= 0.5f;
        leftAreaRect.width -= controlSpacing * 0.5f;

        // The height should be the same as the drop area.
        leftAreaRect.height = dropAreaHeight;

        // Create a Rect for the right GUI controls that is the same as the left Rect except...
        Rect rightAreaRect = leftAreaRect;

        // ... it should be on the right.
        rightAreaRect.x += rightAreaRect.width + controlSpacing;

        // Display the GUI for the type popup and button on the left.
        TypeSelectionGUI(leftAreaRect);
    }

    private void TypeSelectionGUI(Rect containingRect)
    {
        // Create Rects for the top and bottom half.
        Rect topHalf = containingRect;
        topHalf.height *= 0.5f;
        Rect bottomHalf = topHalf;
        bottomHalf.y += bottomHalf.height;

        // Display a popup in the top half showing all the reaction types.
        selectedIndex = EditorGUI.Popup(topHalf, selectedIndex, effectTypeNames);

        // Display a button in the bottom half that if clicked...
        if (GUI.Button(bottomHalf, "Add Selected Effect"))
        {
            // ... finds the type selected by the popup, creates an appropriate reaction and adds it to the array.
            Debug.Log(effectTypes[selectedIndex]);
            Type effectType = effectTypes[selectedIndex];
            Effect newEffect = EffectEditor.CreateEffect(effectType);
            Debug.Log(newEffect);
            effectsProperty.AddToObjectArray(newEffect);
        }
    }
}

public abstract class EffectEditor : Editor
{
    public bool showEffect = true;                       // Is the effect editor expanded?
    public SerializedProperty effectsProperty;    // Represents the SerializedProperty of the array the target belongs to.


    private Effect effect;                      // The target Reaction.


    private const float buttonWidth = 30f;          // Width in pixels of the button to remove this Reaction from the ReactionCollection array.

    private void OnEnable()
    {
        // Cache the target reference.
        effect = (Effect)target;

        // Call an initialisation method for inheriting classes.
        Init();
    }

    // This function should be overridden by inheriting classes that need initialisation.
    protected virtual void Init() { }


    public override void OnInspectorGUI()
    {
        Debug.Log("attempt to draw effect inspector");
        // Pull data from the target into the serializedObject.
        serializedObject.Update();

        EditorGUILayout.BeginVertical(GUI.skin.box);
        EditorGUI.indentLevel++;

        DrawDefaultInspector();

        EditorGUI.indentLevel--;
        EditorGUILayout.EndVertical();

        // Push data back from the serializedObject to the target.
        serializedObject.ApplyModifiedProperties();
    }

    public static Effect CreateEffect(Type effectType)
    {
        // Create a reaction of a given type.
        return (Effect) ScriptableObject.CreateInstance(effectType);
    }
}

[CustomEditor(typeof(DamagePlusXEditor))]
public class DamagePlusXEditor : EffectEditor {}

不确定它是否对您的具体情况有帮助,但我很幸运地将数据存储在纯 C# 类中,然后将这些数据的数组嵌套在 ScriptableObject 中,并且这两个类上的自定义编辑器一起工作。

例如。这个纯数据类(也由其他相当简单的纯类组成):

[System.Serializable]
public class Buff
{
    public CharacterAttribute attribute;
    public CalculationType calculationType;
    public BuffDuration buffDuration;
    public bool effectBool;
    public int effectInt;
    public float effectFloat;
}

编辑器的思路如下:

[CustomPropertyDrawer (typeof (Buff))]
public class BuffDrawer : PropertyDrawer
{
    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
    ...

然后是包含这些“Buff”对象数组的 SO:

[CreateAssetMenu (fileName = "New Buff", menuName = "Data/Buff")]
public class BuffData : ScriptableObject
{
    public new string name;
    public string description;
    public Texture2D icon;
    public Buff [] attributeBuffs;
}

最后是 SO 的编辑器(请参阅底部附近的 PropertyField):

using UnityEngine;
using UnityEditor;

[CustomEditor (typeof (BuffData))]
public class BuffDataEditor : Editor
{
    private const int DescriptionWidthPadding = 35;
    private const float DescriptionHeightPadding = 1.25f;
    private const string AttributesHelpText = 
        "Choose which attributes are to be affected by this buff and by how much.\n" +
        "Note: the calculation type should match the attribute's implementation.";

    private SerializedProperty nameProperty;
    private SerializedProperty descriptionProperty;
    private SerializedProperty iconProperty;
    private SerializedProperty attributeBuffsProperty;

    private void OnEnable ()
    {
        nameProperty = serializedObject.FindProperty ("name");
        descriptionProperty = serializedObject.FindProperty ("description");
        iconProperty = serializedObject.FindProperty ("icon");
        attributeBuffsProperty = serializedObject.FindProperty ("attributeBuffs");
    }

    public override void OnInspectorGUI()
    {
        serializedObject.Update ();

        nameProperty.stringValue = EditorGUILayout.TextField ("Name", nameProperty.stringValue);
        EditorGUILayout.LabelField ("Description:");
        GUIStyle descriptionStyle = new GUIStyle (EditorStyles.textArea)
        {
            wordWrap = true,
            padding = new RectOffset (6, 6, 6, 6),
            fixedWidth = Screen.width - DescriptionWidthPadding
        };
        descriptionStyle.fixedHeight = descriptionStyle.CalcHeight (new GUIContent (descriptionProperty.stringValue), Screen.width) * DescriptionHeightPadding;
        EditorGUI.indentLevel++;
        descriptionProperty.stringValue = EditorGUILayout.TextArea (descriptionProperty.stringValue, descriptionStyle);
        EditorGUI.indentLevel--;
        EditorGUILayout.Space ();
        iconProperty.objectReferenceValue = (Texture2D) EditorGUILayout.ObjectField ("Icon", iconProperty.objectReferenceValue, typeof (Texture2D), false);
        EditorGUILayout.Space ();
        EditorGUILayout.HelpBox (AttributesHelpText, MessageType.Info);
        EditorGUILayout.PropertyField (attributeBuffsProperty, true);

        serializedObject.ApplyModifiedProperties();
    }
}

所有这些都会导致:

检查员示例 https://i.stack.imgur.com/HMpK5.png

无论如何,希望这个例子能给您一些可能对您有所帮助的想法。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Unity 自定义检查器和子检查器 的相关文章

  • XPATH 查询、HtmlAgilityPack 和提取文本

    我一直在尝试从名为 tim new 的类中提取链接 我也得到了解决方案 给出了解决方案 片段和必要的信息here https stackoverflow com questions 2982862 extracting a table ro
  • 并行化斐波那契序列生成器

    我正在学习并行化 在一项练习中 我得到了一些我应该提高性能的算法 其中之一是斐波那契数列生成器 array 0 0 array 1 1 for q 2 q lt MAX q array q array q 1 array q 2 我怀疑 这
  • 异常堆栈跟踪不显示抛出异常的位置

    通常 当我抛出异常 捕获它并打印出堆栈跟踪时 我会看到抛出异常的调用 导致该异常的调用 导致该异常的调用that 依此类推回到整个程序的根 现在它只向我显示异常所在的调用caught 而不是它所在的地方thrown 我不明白是什么改变导致了
  • 将 OpenCV Mat 转换为数组(可能是 NSArray)

    我的 C C 技能很生疏 OpenCV 的文档也相当晦涩难懂 有没有办法获得cv Mat data属性转换为数组 NSArray 我想将其序列化为 JSON 我知道我可以使用 FileStorage 实用程序转换为 YAML XML 但这不
  • 在 ASP.NET MVC 中将模型从视图传递到控制器

    我正在 ASP NET MVC 中开发我的第一个应用程序 但遇到了一个我无法解决的问题 即使在阅读了整个互联网之后也是如此 因此 我有几个使用视图模型创建的视图 它们是报告 这些视图模型是根据用户选择标准填充的 我正在尝试构建一种接受模型并
  • 全局使用和 .NET Standard 2.0

    我最近意识到我可以使用 C 10 功能文件范围的命名空间在 NET Standard 2 0 项目中也可以通过设置
  • while循环中的变量初始化

    我有一个可以分块读取文件的函数 public static DataObject ReadNextFile 数据对象看起来像这样 public DataObject public string Category get set And ot
  • 使用 C# 中的 Google 地图 API 和 SSIS 包获取行驶距离

    更新 找到了谷歌距离矩阵并尝试相应地修改我的代码 我在这里收到无效参数错误 return new GeoLocation dstnc uri ToString catch return new GeoLocation 0 0 https 基
  • 子目录中的头文件(例如 gtk/gtk.h 与 gtk-2.0/gtk/gtk.h)

    我正在尝试使用 GTK 构建一个 hello world 其中包括以下行 include
  • Xamarin - SignalR 挂在连接上

    我正在尝试将我的 Xamarin 应用程序连接到托管在 Azure 上的 SignalR 后端 我遇到的问题是每次我在 HubConnection 上调用 StartAsync 时 它都会挂起客户端并且请求永远不会完成 我尝试通过应用程序进
  • 将错误代码映射到 C++ 中的字符串

    将错误代码从枚举映射到字符串的更有效方法是什么 在 C 中 例如 现在我正在做这样的事情 std string ErrorCodeToString enum errorCode switch errorCode case ERROR ONE
  • C++ 到 C# 事件处理

    所以我有我的C WinForm 应用程序 我从中调用我的C CLI MFC dll图书馆 但也有一些events在我的 C 库上 甚至此事件也发生在该库的本机 非 CLI 部分 我需要从我的 C 应用程序调用一些代码 并获取一些有关此事件的
  • 如何使用 CSI.exe 脚本参数

    当你运行csi exe 安装了 Visual Studio 2015 update 2 您将得到以下语法 Microsoft R Visual C Interactive Compiler version 1 2 0 51106 Copyr
  • 无法在 C# 中为 EventArgs 分配使用派生类型的事件处理程序

    所以我有一个事件声明如下 public event EventHandler OnChangeDetected 然后我有以下处理程序被分配给该事件 myObject OnChangeDetected OnTableChanged 我的理解是
  • 使用 xslt 将 xml 转换为 xsl-fo 时动态创建超链接?

    我想使用 xsl 文件在 PDF 报告中创建标题 如果源文件包含超链接 则应将其呈现为超链接 否则呈现为纯文本 例如 我的 xml 如下所示 a href http google com target blank This is the h
  • C 中使用 getrandom 实现随机浮点数

    我试图生成一个介于 0 和 1 之间的随机浮点数 无论是在 0 1 还是 0 1 对我来说都不重要 网上关于此的每个问题似乎都涉及rand 呼叫 播种time NULL 但我希望能够每秒多次调用我的程序 并每次都获得不同的随机数 这引导我找
  • 如何在dll级别读取app.config? [复制]

    这个问题在这里已经有答案了 我在一个解决方案中有一个控制台应用程序项目和库项目 dll The 图书馆项目有 app config 文件 我在其中存储我在库中使用的一些键值对 控制台应用程序引用此 dll 我有另一个 app config
  • 如何将 int 作为“void *”传递给线程启动函数?

    我最初有一个用于斐波那契变量数组的全局变量 但发现这是不允许的 我需要进行基本的多线程处理并处理竞争条件 但我无法在 pthread 创建中将 int 作为 void 参数提供 我尝试过使用常量指针 但没有成功 由于某些奇怪的原因 void
  • “必须声明标量变量”错误[重复]

    这个问题在这里已经有答案了 必须声明标量变量 Id SqlConnection con new SqlConnection connectionstring con Open SqlCommand cmd new SqlCommand cm
  • 这种尺寸对齐是如何工作的

    对于所提供的评论 我无法理解以下代码 这段代码的作用是什么 以及等效的代码是什么8 aligned segment size must be 4 aligned attr gt options ssize 3 Here ssize is o

随机推荐

  • 如何从在 Cron 作业上运行的 Python 解锁 Gnome 密钥环?

    我正在连接一个 Python 脚本来与 cron 一起运行 在 Ubuntu 12 04 上 但身份验证不起作用 cron 脚本访问几个服务 并且必须提供凭据 存储这些凭证keyring很简单 只不过当 cron 作业实际运行时 无法检索凭
  • Map:如何获取与某个值关联的所有键?

    给定一个 Map 如何查找与特定值关联的所有键 例如 Map
  • 背包多重约束

    我有一个动态规划问题 我花了几个小时研究但没有结果 第一部分很简单 你有一背包物品 你必须最大化这些物品的价值 同时将它们保持在一定的重量以下 问题的第二部分是相同的 只是现在也有一个项目限制 例如 您可以放入袋子中的物品的最大价值是多少
  • 查看 PHP 闭包的源代码

    是否可以反映或以其他方式查看 PHP 闭包对象的源代码 也就是说 如果我做这样的事情 closure function return Hi There 然后是这样的 var dump closure PHP 输出 object Closur
  • 是否可以在activerecord中定义与SQL表达式对应的虚拟属性?

    我正在寻找类似虚拟属性的东西 但这可以在数据库级别上工作 假设我有一个字段age我想添加一个 虚拟字段 age quintile这等于age 5 但可以这样说 Person select age quintile agv height gr
  • Python 元组作为键慢吗?

    我正在尝试实现字典中排序元组的快速查找 回答 元组 3 8 是否有关联值 如果有 它是什么 的问题 令元组中的整数从下方以 0 为界 从上方以 max int 为界 我继续使用 Python 的 dict 但发现速度相当慢 解决此问题的另一
  • 获取以 UTC 表示的当前时间的最简单 PowerShell 方法

    我已查看该帖子在 PowerShell 中创建具有特定 UTC 日期时间的 DateTime 对象 https stackoverflow com questions 10487011 creating a datetime object
  • 非活动状态下的 Spring Boot 堆使用情况

    我在本地部署了一个非常简单的 spring boot 应用程序 它只有一个类 控制器 差不多就这样了 我注意到堆分配并不稳定 并且有峰值和突然下降 为什么会这样 我没有对应用程序进行过一次调用 A view from VisualVM 事实
  • 释放指针向量,但内存仍在使用中

    我不知道下面的代码有什么问题 我正在删除所有指针 但是当我使用 top 命令查看内存时 我可以看到仍然有大量内存分配给程序 我在这里缺少一些东西来释放内存吗 include
  • 重新加载 tslib 触摸屏校准

    背景 我正在开发一个基于 Qt 的大型 GUI 它处理与触摸屏的所有用户交互 该程序的设计使得用户不需要访问命令提示符即可执行任何操作 包括重新校准触摸屏 我写了一个 tslib 的模仿品ts calibrate作为运行的实用程序QWidg
  • 触发 Outlook 事件:更改签名

    有谁知道是否可以在 Outlook 2016 中触发签名更改事件 IE 模拟点击签名 如下图所示 我正在尝试根据选择的 发件人 地址自动更改签名 我可以捕获 发件人 地址更改 如所回答here https stackoverflow com
  • Android 布局:运行第二次布局

    我正在扩展 TextView 并加载自定义字体 我在列表视图中使用这个自定义文本视图 当我滚动列表时 有时会收到以下调试消息 布局期间 com sample CustomTextView 52afae4c V ED ID 0 27 27 4
  • 在 R 中使用 tcltk 在弹出窗口(表格小部件)中显示数据 - 为什么它会删除最后一行数据?

    我正在努力创建一个小部件来使用 tcl tk 在弹出窗口中查看表格 我正在遵循这个例子 http r 789695 n4 nabble com Tck tk help td1837711 html http r 789695 n4 nabb
  • Laravel 中的下拉选择表单

    我可以知道我的代码有什么问题吗 我在数据库中注册了三个用户类型名称 但是我的代码将导致三个下拉菜单 每个菜单上都有单独的用户类型名称 foreach user types as usertype div class form group F
  • Julia 中的指针解引用(unsafe_load(ptr) 有效,但 unsafe_wrap(Array, ptr, 1) 段错误)

    我正在尝试取消引用指针unsafe load and unsafe wrap 我发现unsafe load不过效果很好unsafe wrap如果取消引用指向可变结构的指针 则会崩溃 玩具示例 mutable struct Wrapper d
  • 在Android中解析HTML

    我正在尝试从网页解析 android 中的 HTML 由于该网页格式不正确 我得到SAXException Android 有没有办法解析 HTML 我刚刚遇到这个问题 我尝试了一些东西 但决定使用JSoup http jsoup org
  • 如何从文本文件读取数据并将其推回向量?

    我有一个文本文件 test txt 它存储了我的数据 如下所示 每个分隔符字段之间有一个空格 代码 名称 Coy 045 Ted Coy1 054 Red Coy2 我如何从文件中读取这些数据并将其插入向量中 vector
  • GoogleCalendarAPI 接受/拒绝事件

    我正在研究谷歌日历API并使用node js作为构建我的应用程序的平台 我能够使用身份验证过程创建事件 并使用身份验证时生成的访问令牌创建日历事件 我的问题是 假设如果我们有任何参加者参加活动 并且我想使用参加者一方的日历 API 接受 拒
  • android OkHttpClient请求错误

    我正在尝试使用我的 Android 应用程序在 mysql 数据库中存储一些数据 我正在使用 okhttp3 发送请求 但在这一行出现错误 client newCall request execute 我在本地机器和在线上尝试过 但它给了我
  • Unity 自定义检查器和子检查器

    我正在Unity 2017 2 中开发一个小型ARPG 我尝试为我的游戏的能力蓝图类实现自定义编辑器 基本上 AbilityBluePrint 包含在运行时生成能力所需的所有信息 包括一个 Effect ScritpableObjects