Skip to content

Instantly share code, notes, and snippets.

@monry
Created August 24, 2021 15:05
Show Gist options
  • Save monry/d13ae5c78a887c8c775ef15bdaebcd99 to your computer and use it in GitHub Desktop.
Save monry/d13ae5c78a887c8c775ef15bdaebcd99 to your computer and use it in GitHub Desktop.
[field: SerializeField] な属性を付けた Property の表示テスト用 MonoBehaviour
using System;
using UnityEngine;
namespace Monry
{
public class Sample : MonoBehaviour
{
[field: SerializeField] private int IntValue { get; set; }
[field: SerializeField] private bool BoolValue { get; set; }
[field: SerializeField] private string StringValue { get; set; }
[field: SerializeField] private FooBarStruct FooBar { get; set; }
[Serializable]
private struct FooBarStruct
{
[field: SerializeField] private int IntValue { get; set; }
[field: SerializeField] private bool BoolValue { get; set; }
[field: SerializeField] private string StringValue { get; set; }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment