Last active
December 21, 2017 08:04
-
-
Save 0V/f631c035c22abd7603245d6daa326bf7 to your computer and use it in GitHub Desktop.
Unity でインスペクター操作可能なプロパティを作るスニペット
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[SerializeField] | |
private int _Score; | |
public int Score | |
{ | |
get { return _Score; } | |
set { _Score = value; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2008/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Unity SerializeField プロパティ</Title> | |
<Shortcut>uprop</Shortcut> | |
<Author>G2</Author> | |
<Description>Unityのインスペクターで操作可能なプロパティを作成します</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal> | |
<ID>type</ID> | |
<ToolTip>プロパティの型</ToolTip> | |
<Default>int</Default> | |
</Literal> | |
<Literal> | |
<ID>name</ID> | |
<ToolTip>プロパティ名</ToolTip> | |
<Default>MyProperty</Default> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp"> | |
<![CDATA[ | |
#region $name$ Unity SerializeField プロパティ | |
[SerializeField] | |
private $type$ _$name$; | |
public $type$ $name$ | |
{ | |
get | |
{ return _$name$; } | |
set | |
{ _$name$ = value; } | |
} | |
#endregion | |
]]> | |
</Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment