Newer
Older
DungeonShooting / DungeonShooting_Godot / src / framework / map / SerializeVector2.cs

using System;
using System.Text.Json.Serialization;
using Godot;

/// <summary>
/// 可序列化的 Vector2 对象
/// </summary>
[Serializable]
public class SerializeVector2
{
    public SerializeVector2(float x, float y)
    {
        X = x;
        Y = y;
    }

    public SerializeVector2(Vector2 v)
    {
        X = v.X;
        Y = v.Y;
    }

    public SerializeVector2(Vector2I v)
    {
        X = v.X;
        Y = v.Y;
    }

    public SerializeVector2()
    {
        
    }

    
    [JsonInclude]
    public float X;
    [JsonInclude]
    public float Y;
}