Skip to content

Commit

Permalink
Fix character data null expression
Browse files Browse the repository at this point in the history
  • Loading branch information
BDeshiDev committed Apr 9, 2024
1 parent b85bdb4 commit 2457482
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 3 deletions.
17 changes: 17 additions & 0 deletions Assets/New Character Data.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8c9b81d87e51f0f4197c65dca5fe6aec, type: 3}
m_Name: New Character Data
m_EditorClassIdentifier:
CharacterName:
DialogueColor: {r: 0, g: 0, b: 0, a: 0}
Expressions: []
8 changes: 8 additions & 0 deletions Assets/New Character Data.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
if (lineSpeakerData.Character != null)
{
position.y += EditorGUIUtility.singleLineHeight;
var expressions = lineSpeakerData.Character.Expressions.Select(ced => ced.ExpressionName).ToArray();
var expressions = lineSpeakerData.Character.Expressions
.Where(ced => ced != null)
.Select(ced => ced.ExpressionName).ToArray();
// EditorGUI.LabelField(position," :" + lineSpeakerData);
if (expressions.Length == 0)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6522073147610097109
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2ea1a97ac8dd4be5aa1587a59f11d10d, type: 3}
m_Name: Victor_U DARE SHOOT ME
m_EditorClassIdentifier:
Character: {fileID: 11400000}
ExpressionName: U DARE SHOOT ME
Image: {fileID: 0}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8c9b81d87e51f0f4197c65dca5fe6aec, type: 3}
m_Name: Narupo
m_EditorClassIdentifier:
CharacterName: Victor
DialogueColor: {r: 0, g: 0.4576635, b: 0.49056602, a: 1}
Expressions: []

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ MonoBehaviour:
m_WaitForCompletion: 0
m_LocalVariables: []
SpeakerData:
Character: {fileID: 0}
Character: {fileID: 11400000, guid: 0480fe1505a2908449d82e07dffcbca0, type: 2}
Expression: {fileID: 0}
FMODEvent:
Exit: {fileID: 0}
Expand Down Expand Up @@ -897,7 +897,7 @@ MonoBehaviour:
m_WaitForCompletion: 0
m_LocalVariables: []
SpeakerData:
Character: {fileID: 0}
Character: {fileID: 11400000, guid: f206f19a5eeee3b4282901b5353fd9ea, type: 2}
Expression: {fileID: 0}
FMODEvent:
Exit: {fileID: 0}
Expand Down

0 comments on commit 2457482

Please sign in to comment.