Skip to content
Snippets Groups Projects
Commit ee0b7a2b authored by Sven Gerlach's avatar Sven Gerlach
Browse files

UI Styling

parent 85f119ff
No related branches found
No related tags found
No related merge requests found
Showing
with 872 additions and 757 deletions
......@@ -20,7 +20,7 @@ MonoBehaviour:
mLastUsedPackagesHash: 1187110788
mLastUsedPackagesCount: 1
mLastBuildCode: 1
mLastEditorStartupTimeTicks: 638192984127926069
mLastEditorStartupTimeTicks: 638193835499770870
mNewVersionAvailable: 0
mLastSelectedCustomGvPath:
mLastAttachedFlowPlayerValue: 0
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2446674854737357872
--- !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: -1676762633, guid: df2ec02f61e861546b9427c26ccacb8d, type: 3}
m_Name: ArticyDatabase
m_EditorClassIdentifier:
mHierarchy: {fileID: 2403019185819948930}
mLocalization: {fileID: 1105480772320505602}
mInternalProject:
mName: VIA/VR Scenario
mDetailName:
mId: 60d852f6-273d-4a9a-8b83-eef79f8dc671
mTechnicalName: ViaVr
mImportedAssets: []
mDefaultGlobalVariables: {fileID: 3353970325780243873}
mScriptFragments: {fileID: 5566347060672431205}
mPackages:
- PackageName: Export package
PackagePath: Export package
mIsDefaultPackage: 1
--- !u!114 &1105480772320505602
MonoBehaviour:
m_ObjectHideFlags: 3
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: 1174674681, guid: df2ec02f61e861546b9427c26ccacb8d, type: 3}
m_Name: LocalizationManager
m_EditorClassIdentifier:
OnLanguageChanged:
m_PersistentCalls:
m_Calls: []
mUseLocalization: 0
mLanguage: en
mThrowOnMissingText: 0
mClearOnLanguageSwitch: 1
mExportLanguage: en
--- !u!114 &2403019185819948930
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
......@@ -263,52 +309,6 @@ MonoBehaviour:
technicalName:
articyType: RuleSetPackage
childCount: 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: -1676762633, guid: df2ec02f61e861546b9427c26ccacb8d, type: 3}
m_Name: ArticyDatabase
m_EditorClassIdentifier:
mHierarchy: {fileID: -2446674854737357872}
mLocalization: {fileID: 1105480772320505602}
mInternalProject:
mName: VIA/VR Scenario
mDetailName:
mId: 60d852f6-273d-4a9a-8b83-eef79f8dc671
mTechnicalName: ViaVr
mImportedAssets: []
mDefaultGlobalVariables: {fileID: 3353970325780243873}
mScriptFragments: {fileID: 5566347060672431205}
mPackages:
- PackageName: Export package
PackagePath: Export package
mIsDefaultPackage: 1
--- !u!114 &1105480772320505602
MonoBehaviour:
m_ObjectHideFlags: 3
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: 1174674681, guid: df2ec02f61e861546b9427c26ccacb8d, type: 3}
m_Name: LocalizationManager
m_EditorClassIdentifier:
OnLanguageChanged:
m_PersistentCalls:
m_Calls: []
mUseLocalization: 0
mLanguage: en
mThrowOnMissingText: 0
mClearOnLanguageSwitch: 1
mExportLanguage: en
--- !u!114 &3353970325780243873
MonoBehaviour:
m_ObjectHideFlags: 1
......@@ -336,7 +336,11 @@ MonoBehaviour:
- '"Hello"'
LiveBoolVariableCache: []
LiveIntVariableCache: []
LiveStringVariableCache: []
LiveStringVariableCache:
- mFullQualifiedName: Variables.Question
mVar:
values:
- '"Hello"'
isInitialized: 1
mVariables:
_VariableStorage: {fileID: 3353970325780243873}
......
fileFormatVersion: 2
guid: 0b8273a2bc7dfa947bc94b4f864eb14a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Copyright 2014-2017 Indian Type Foundry (info@indiantypefoundry.com). Copyright 2019 Google LLC.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
fileFormatVersion: 2
guid: dffb35dc580335e4ba8f3cdf44e5ddcd
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File added
fileFormatVersion: 2
guid: 13b9c7832bc13194cbf6816446bab4c8
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontNames:
- DM Sans
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:
File added
fileFormatVersion: 2
guid: a6da1212db0088c439f22fdd5d5f34f3
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontNames:
- DM Sans Medium
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:
.outerShell {
background-image: url("/Assets/DialogSystem/Assets/outer.png");
width: 1350px;
height: 1350px;
overflow: hidden;
width: auto;
height: auto;
}
.innerShell {
background-image: url("/Assets/DialogSystem/Assets/inner.png");
width: 1300px;
height: 1300px;
margin-top: 25px;
margin-bottom: 25px;
margin-left: 25px;
margin-right: 25px;
width: auto;
height: auto;
overflow: hidden;
margin: 20px;
align-self: center;
}
Label {
-unity-font-style:bold;
-unity-font-definition: url("/Assets/DialogSystem/Assets/Fonts/DMSans-Bold.ttf");
color: rgb(255, 255, 255);
margin-top: 50px;
margin-left: 25px;
background-color: rgba(0,0,0,0.075);
width: 1150px;
margin-top: 70px;
margin-left: 90px;
margin-right: 90px;
margin-bottom: 20px;
}
TextElement {
-unity-font-style:normal;
-unity-font-definition: url("/Assets/DialogSystem/Assets/Fonts/DMSans-Medium.ttf");
font-size: 70px;
color: rgb(255,255,255);
width: 1200px;
height: 350px;
background-color: rgba(0,0,0,0.075);
width: 1150px;
height: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 50px;
flex-direction: column;
margin-left: 90px;
margin-right: 90px;
}
Button {
font-size: 45px;
-unity-font-style: bold;
font-size: 55px;
-unity-font-definition: url("/Assets/DialogSystem/Assets/Fonts/DMSans-Bold.ttf");
-unity-text-align: middle-center;
color: rgb(255,255,255);
background-color: rgba(100,100,100,0.8);
overflow: hidden;
text-overflow: ellipsis;
width: 500px;
background-color: rgba(100,100,100,0.8);
flex-direction: column;
width: 1150px;
height: 125px;
margin-top: 5px;
min-height: 125px;
margin-bottom: 15px;
margin-left: 15px;
margin-right: 15px;
padding-top: 15px;
align-self: center;
}
.row{
flex-direction: row;
padding-top: 20px;
margin-left: 15px;
margin-bottom: 150px;
.container {
min-height: 125px;
height: auto;
margin-top: 25px;
margin-bottom: 75px;
}
\ No newline at end of file
<UXML xmlns="UnityEngine.UIElements">
<VisualElement class="outerShell">
<VisualElement class="innerShell">
<Label name="Actor"/>
<VisualElement class="row">
<TextElement name="Dialogue"/>
</VisualElement>
<VisualElement class="container">
<Label name="Actor"/>
<TextElement name="Dialogue"/>
<VisualElement class="container" name="buttonContainer">
<Button name="Button1"/>
<Button name="Button2"/>
<Button name="Button3"/>
......
......@@ -4,45 +4,55 @@
using UnityEngine.UIElements;
using UnityEngine.EventSystems;
// idea: remove buttons & change font size if distance > than a certain amount
public class DynamicFontResize : MonoBehaviour
{
private UIDocument uiDocument;
[SerializeField] Katas.Experimental.WorldSpaceUIDocument worldSpaceUIDocument;
private Katas.Experimental.WorldSpaceUIDocument worldSpaceUIDocument;
private WorldSpaceDialogueBox dialogueBox;
private Camera _camera;
private VisualElement root;
public float currentdistance;
public float tiny = 50;
public float big = 65;
private float currentdistance;
private bool once;
public float mindistance = 2;
public float maxdistance = 5;
public float nearActorSize = 90;
public float farActorSize = 120;
public float nearTextSize = 70;
public float farTextSize = 100;
public float mindistance = 1;
private Button[] buttons;
public void Start() {
_camera = Camera.main;
worldSpaceUIDocument = GetComponent<Katas.Experimental.WorldSpaceUIDocument>();
worldSpaceUIDocument.onUIDocumentReady.AddListener(setUIDocument);
}
public void Update() {
dialogueBox = GetComponent<WorldSpaceDialogueBox>();
currentdistance = DistanceToCamera(this.gameObject.transform.position);
if (currentdistance > mindistance) {
root.Q<Label>("Actor").style.fontSize = big;
root.Q<TextElement>("Dialogue").style.fontSize = big;
root.Q<VisualElement>("Container").style.visibility = Visibility.Visible;
worldSpaceUIDocument.RefreshPanelSize();
once = true;
}
else {
root.Q<Label>("Actor").style.fontSize = tiny;
root.Q<TextElement>("Dialogue").style.fontSize = tiny;
root.Q<VisualElement>("Container").style.visibility = Visibility.Hidden;
worldSpaceUIDocument.RefreshPanelSize();
once = false;
}
}
public void Update() {
currentdistance = DistanceToCamera(this.gameObject.transform.position);
if (currentdistance > mindistance && once) {
once = false;
dialogueBox.SetActorFontSize(farActorSize);
dialogueBox.SetTextFontSize(farTextSize);
}
if (currentdistance < mindistance && once == false) {
once = true;
dialogueBox.SetActorFontSize(nearActorSize);
dialogueBox.SetTextFontSize(nearTextSize);
}
}
private void setUIDocument() {
uiDocument = GetComponent<UIDocument>();
root = uiDocument.rootVisualElement;
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5313695097596267024
--- !u!1 &8170552307152042535
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
......@@ -8,13 +8,14 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5313695097596267050}
- component: {fileID: 5313695097596267051}
- component: {fileID: 5313695097596267028}
- component: {fileID: 5313695097596267029}
- component: {fileID: 5313695097596267030}
- component: {fileID: 5313695097596267049}
- component: {fileID: 5313695097596267048}
- component: {fileID: 8170552307152042525}
- component: {fileID: 8170552307152042524}
- component: {fileID: 8170552307152042531}
- component: {fileID: 8170552307152042530}
- component: {fileID: 8170552307152042529}
- component: {fileID: 8170552307152042526}
- component: {fileID: 8170552307152042527}
- component: {fileID: 8170552307152042520}
m_Layer: 0
m_Name: WorldSpaceDialogueBox
m_TagString: Untagged
......@@ -22,35 +23,35 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5313695097596267050
--- !u!4 &8170552307152042525
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5313695097596267024}
m_GameObject: {fileID: 8170552307152042535}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.17, y: 1.35, z: -9.08}
m_LocalPosition: {x: 0.17, y: 0.995, z: -8.908}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &5313695097596267051
--- !u!114 &8170552307152042524
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5313695097596267024}
m_GameObject: {fileID: 8170552307152042535}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fbbce919b93a804449b8e74c7b1eec1b, type: 3}
m_Name:
m_EditorClassIdentifier:
_panelWidth: 1350
_panelHeight: 1350
_panelHeight: 2750
_panelScale: 1
_pixelsPerUnit: 1350
_visualTreeAsset: {fileID: 0}
......@@ -60,13 +61,13 @@ MonoBehaviour:
onUIDocumentReady:
m_PersistentCalls:
m_Calls: []
--- !u!114 &5313695097596267028
--- !u!114 &8170552307152042531
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5313695097596267024}
m_GameObject: {fileID: 8170552307152042535}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f6a8876d339d1ce4dbb83ea0158084f2, type: 3}
......@@ -74,15 +75,15 @@ MonoBehaviour:
m_EditorClassIdentifier:
visualTree: {fileID: 9197481963319205126, guid: 603e8ecda2bc66148be7bc0929e2f25b, type: 3}
styleSheet: {fileID: 7433441132597879392, guid: 78ec576a11766354b9c6c1e555acf5e4, type: 3}
worldSpaceUIDocument: {fileID: 5313695097596267051}
worldSpaceUIDocument: {fileID: 8170552307152042524}
defaultButtonText: Continue
--- !u!114 &5313695097596267029
--- !u!114 &8170552307152042530
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5313695097596267024}
m_GameObject: {fileID: 8170552307152042535}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6df61a9a13528fd4f9365c233cb23bfb, type: 3}
......@@ -94,13 +95,13 @@ MonoBehaviour:
m_Bits: 4294967295
m_MaxRayIntersections: 10
m_EventCamera: {fileID: 0}
--- !u!114 &5313695097596267030
--- !u!114 &8170552307152042529
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5313695097596267024}
m_GameObject: {fileID: 8170552307152042535}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 149237616, guid: df2ec02f61e861546b9427c26ccacb8d, type: 3}
......@@ -113,31 +114,31 @@ MonoBehaviour:
startOn:
instanceId: 0
referencingMode: 0
lowId: 0
highId: 0
lowId: 62
highId: 16777216
pauseOn: 7
ignoreInvalidBranches: 1
continuouslyRecalculateBranches: 0
continouslyRecalculateInterval: 1
--- !u!114 &5313695097596267049
--- !u!114 &8170552307152042526
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5313695097596267024}
m_GameObject: {fileID: 8170552307152042535}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2a59cd820c99c234fa950e2b034e9fa0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &5313695097596267048
--- !u!114 &8170552307152042527
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5313695097596267024}
m_GameObject: {fileID: 8170552307152042535}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 04f433ebeda01b14092e4f7f84512a40, type: 3}
......@@ -146,10 +147,27 @@ MonoBehaviour:
aPress:
instanceId: 0
referencingMode: 0
lowId: 62
lowId: 153
highId: 16777216
bPress:
instanceId: 0
referencingMode: 0
lowId: 43
lowId: 62
highId: 16777216
--- !u!114 &8170552307152042520
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8170552307152042535}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5a332296198675d44bbd20ea9410e0c7, type: 3}
m_Name:
m_EditorClassIdentifier:
nearActorSize: 90
farActorSize: 150
nearTextSize: 70
farTextSize: 110
mindistance: 2
......@@ -25,6 +25,16 @@ public void Awake() {
worldSpaceUIDocument.onUIDocumentReady.AddListener(setUIDocument);
}
public void Update() {
if (Input.GetKeyDown("space") && root != null)
{
Debug.Log(root.Q<Label>("Actor").style.fontSize);
Debug.Log(root.Q<TextElement>("Dialogue").style.fontSize);
}
}
private void setUIDocument() {
uiDocument = GetComponent<UIDocument>();
root = uiDocument.rootVisualElement;
......@@ -44,23 +54,31 @@ public void ClearUI() {
SetActor(string.Empty);
SetText(string.Empty);
for (var i = 0; i < buttons.Length; i++)
buttons[i].visible = false;
buttons[i].style.display = DisplayStyle.None;
}
public void SetActor(string actor) {
root.Q<Label>("Actor").text = actor;
}
public void SetActorFontSize(float size) {
root.Q<Label>("Actor").style.fontSize = size;
}
public void SetText(string text) {
root.Q<TextElement>("Dialogue").text = text;
}
public void SetTextFontSize(float size) {
root.Q<TextElement>("Dialogue").style.fontSize = size;
}
public void SetTransitions(IList<Branch> branches) {
for (var i = 0; i < buttons.Length; i++) {
buttons[i].text = string.Empty;
if (i < branches.Count) {
buttons[i].visible = true;
buttons[i].style.display = DisplayStyle.Flex;
var menuText = branches[i].Target as IObjectWithMenuText;
if (menuText != null && menuText.MenuText != string.Empty) {
......@@ -71,7 +89,7 @@ public void SetTransitions(IList<Branch> branches) {
}
}
else {
buttons[i].visible = false;
buttons[i].style.display = DisplayStyle.None;
}
}
}
......
......@@ -207,159 +207,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1621041051
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1621041057}
- component: {fileID: 1621041056}
- component: {fileID: 1621041055}
- component: {fileID: 1621041054}
- component: {fileID: 1621041053}
- component: {fileID: 1621041058}
- component: {fileID: 1621041059}
m_Layer: 0
m_Name: WorldSpaceDialogueBox
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1621041053
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1621041051}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 149237616, guid: df2ec02f61e861546b9427c26ccacb8d, type: 3}
m_Name:
m_EditorClassIdentifier:
useDefaultGlobalVariables: 1
globalVariables: {fileID: 0}
overwriteMethodProvider: 0
overwrittenMethodProvider: {fileID: 0}
startOn:
instanceId: 0
referencingMode: 0
lowId: 62
highId: 16777216
pauseOn: 7
ignoreInvalidBranches: 1
continuouslyRecalculateBranches: 0
continouslyRecalculateInterval: 1
--- !u!114 &1621041054
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1621041051}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6df61a9a13528fd4f9365c233cb23bfb, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RaycastTriggerInteraction: 1
m_EventMask:
serializedVersion: 2
m_Bits: 4294967295
m_MaxRayIntersections: 10
m_EventCamera: {fileID: 0}
--- !u!114 &1621041055
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1621041051}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f6a8876d339d1ce4dbb83ea0158084f2, type: 3}
m_Name:
m_EditorClassIdentifier:
visualTree: {fileID: 9197481963319205126, guid: 603e8ecda2bc66148be7bc0929e2f25b, type: 3}
styleSheet: {fileID: 7433441132597879392, guid: 78ec576a11766354b9c6c1e555acf5e4, type: 3}
worldSpaceUIDocument: {fileID: 1621041056}
defaultButtonText: Continue
--- !u!114 &1621041056
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1621041051}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fbbce919b93a804449b8e74c7b1eec1b, type: 3}
m_Name:
m_EditorClassIdentifier:
_panelWidth: 1280
_panelHeight: 720
_panelScale: 1
_pixelsPerUnit: 1280
_visualTreeAsset: {fileID: 0}
_panelSettingsPrefab: {fileID: 11400000, guid: fd07337020fac9f4d817f2d168694173, type: 2}
_renderTexturePrefab: {fileID: 8400000, guid: 17662cfbd375e554d91b75bf67594f93, type: 2}
UseDragEventFix: 0
onUIDocumentReady:
m_PersistentCalls:
m_Calls: []
--- !u!4 &1621041057
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1621041051}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.17, y: 1.35, z: -9.08}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1621041058
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1621041051}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2a59cd820c99c234fa950e2b034e9fa0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1621041059
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1621041051}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 04f433ebeda01b14092e4f7f84512a40, type: 3}
m_Name:
m_EditorClassIdentifier:
aPress:
instanceId: 0
referencingMode: 0
lowId: 62
highId: 16777216
bPress:
instanceId: 0
referencingMode: 0
lowId: 43
highId: 16777216
--- !u!1 &1933320861
GameObject:
m_ObjectHideFlags: 0
......@@ -448,7 +295,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1933320861}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalPosition: {x: 23.51, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
......@@ -475,3 +322,60 @@ MonoBehaviour:
m_ShadowLayerMask: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
--- !u!1001 &8170552307681109436
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalPosition.x
value: 0.17
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalPosition.y
value: 0.995
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalPosition.z
value: -8.908
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042525, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8170552307152042535, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
propertyPath: m_Name
value: WorldSpaceDialogueBox
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8cfe3f32eae0d304285287fececf058b, type: 3}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment