Skip to content

Commit

Permalink
Added character body expression
Browse files Browse the repository at this point in the history
  • Loading branch information
dipokDipu committed Oct 16, 2024
1 parent c5e4933 commit 89ad3f5
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Assets/Packages/com.studio23.ss2.dialoguesystem/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [0.4.30]
1. Character body expression added

## [0.4.29]
1. Character expression fixed for localization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class LineSpeakerDataPropertyDrawer:PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return base.GetPropertyHeight(property, label) * 3;
return base.GetPropertyHeight(property, label) * 4;
}

public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
Expand All @@ -33,8 +33,19 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
var charFieldRect = position;
charFieldRect.height = EditorGUIUtility.singleLineHeight;
EditorGUI.PropertyField(charFieldRect, property.FindPropertyRelative("Character"), new GUIContent("Character"));


position.y += EditorGUIUtility.singleLineHeight;
var expressionRect = position;
expressionRect.height = EditorGUIUtility.singleLineHeight;

EditorGUI.LabelField(expressionRect, new GUIContent("ExpressionData"));



if (lineSpeakerData.Character != null)
{

position.y += EditorGUIUtility.singleLineHeight;
var expressions = lineSpeakerData.Character.Expressions
.Where(ced => ced != null)
Expand Down Expand Up @@ -75,6 +86,14 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
EditorGUI.HelpBox(position, "NO CharacterData", MessageType.Error);
}

position.y += EditorGUIUtility.singleLineHeight;
var bodyRect = position;
bodyRect.height = EditorGUIUtility.singleLineHeight;

EditorGUI.PropertyField(bodyRect, property.FindPropertyRelative("BodyData"), new GUIContent("BodyData"));



// Set indent back to what it was
EditorGUI.indentLevel = indent;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using UnityEngine;

namespace Studio23.SS2.DialogueSystem.Data
{
[CreateAssetMenu(menuName = "Studio-23/Dialogue System/Character Body Expression", fileName = "Character Body Expression")]
[Serializable]
public class CharacterBodyExpression : ScriptableObject
{
public string ExpressionName;
}
}

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 @@ -8,5 +8,6 @@ public class LineSpeakerData
{
public CharacterData Character;
public CharacterExpressionData Expression;
public CharacterBodyExpression BodyData;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.studio23.ss2.dialoguesystem",
"version": "0.4.29",
"version": "0.4.30",
"displayName": "Dialogue System",
"description": "Dialogue system is an authoring tool for developers to integrate dialogue from scriptwriters inside unity.",
"unity": "2022.3",
Expand Down

0 comments on commit 89ad3f5

Please sign in to comment.