Skip to content

Commit

Permalink
feat: ScriptableLogicのユーザー変数ラベルが空の場合は型の名前を出しておくように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
pspkurara committed Sep 9, 2020
1 parent 0a848ca commit 5e66e65
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ private bool CreateDisplayData(UserLogic userLogic)
{
bool isUnCorrect = false;
var data = new UserLogicVariableDisplayData();
if (SkinnerSystemType.IsObject(v.FieldType))
if (v.FieldType == null)
{
// 型すら指定されてない場合は何も表示させるべきではない
isUnCorrect = true;
}
else if (SkinnerSystemType.IsObject(v.FieldType))
{
data.PropertyType = SerializedPropertyType.ObjectReference;
data.FieldIndex = objectReferenceArrayCount;
Expand Down Expand Up @@ -301,7 +306,9 @@ private bool CreateDisplayData(UserLogic userLogic)
}
if (!isUnCorrect)
{
data.DisplayName = new GUIContent(v.FieldDisplayName);
// 名前が未設定の場合は型の名前を出しておく
var displayName = v.FieldDisplayName == null ? SkinnerEditorUtility.GetEditorName(v.FieldType.Name) : v.FieldDisplayName;
data.DisplayName = new GUIContent(displayName);
data.VariableData = v;
userLogicVariableDisplayDatas.Add(data);
}
Expand Down

0 comments on commit 5e66e65

Please sign in to comment.