Skip to content

Commit

Permalink
add exit buttons to samples
Browse files Browse the repository at this point in the history
  • Loading branch information
amakropoulos committed Mar 7, 2024
1 parent f9c906a commit c7224b5
Show file tree
Hide file tree
Showing 8 changed files with 453 additions and 41 deletions.
6 changes: 6 additions & 0 deletions Samples~/ChatBot/ChatBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,11 @@ void Update()
lastBubbleOutsideFOV = -1;
}
}

public void ExitGame()
{
Debug.Log("Exit button clicked");
Application.Quit();
}
}
}
14 changes: 0 additions & 14 deletions Samples~/ChatBot/ExitButton.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Samples~/ChatBot/ExitButton.cs.meta

This file was deleted.

19 changes: 4 additions & 15 deletions Samples~/ChatBot/Scene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ MonoBehaviour:
parallelPrompts: -1
debug: 0
asynchronousStartup: 0
remote: 0
killExistingServersOnStart: 1
model:
lora:
contextSize: 512
Expand Down Expand Up @@ -889,7 +891,6 @@ GameObject:
- component: {fileID: 1788474018}
- component: {fileID: 1788474017}
- component: {fileID: 1788474016}
- component: {fileID: 1788474019}
m_Layer: 5
m_Name: ExitButton
m_TagString: Untagged
Expand Down Expand Up @@ -961,8 +962,8 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1788474019}
m_TargetAssemblyTypeName: ExitButton, Assembly-CSharp
- m_Target: {fileID: 180020066}
m_TargetAssemblyTypeName: LLMUnitySamples.ChatBot, Assembly-CSharp
m_MethodName: ExitGame
m_Mode: 1
m_Arguments:
Expand Down Expand Up @@ -1011,18 +1012,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1788474014}
m_CullTransparentMesh: 1
--- !u!114 &1788474019
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1788474014}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da33e8a729588434a81b3973cf7d2113, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1833883732
GameObject:
m_ObjectHideFlags: 0
Expand Down
215 changes: 215 additions & 0 deletions Samples~/ServerClient/Scene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,93 @@ RectTransform:
- {fileID: 1342801405}
- {fileID: 1448762425}
- {fileID: 1116321462}
- {fileID: 834540939}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &232793937
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 232793938}
- component: {fileID: 232793940}
- component: {fileID: 232793939}
m_Layer: 5
m_Name: Text (Legacy)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &232793938
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 232793937}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 834540939}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 2}
m_SizeDelta: {x: 25, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &232793939
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 232793937}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\xD7"
--- !u!222 &232793940
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 232793937}
m_CullTransparentMesh: 1
--- !u!1 &261091095
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -650,6 +730,139 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: -20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &834540938
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 834540939}
- component: {fileID: 834540942}
- component: {fileID: 834540941}
- component: {fileID: 834540940}
m_Layer: 5
m_Name: ExitButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &834540939
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 834540938}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 232793938}
m_Father: {fileID: 158550917}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 25, y: 25}
m_Pivot: {x: 1, y: 1}
--- !u!114 &834540940
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 834540938}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 834540941}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 978410682}
m_TargetAssemblyTypeName: ServerClient, Assembly-CSharp
m_MethodName: ExitGame
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 1
--- !u!114 &834540941
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 834540938}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.24722636, g: 0.24722636, b: 0.24722636, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &834540942
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 834540938}
m_CullTransparentMesh: 1
--- !u!1 &856480601
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1258,6 +1471,8 @@ MonoBehaviour:
parallelPrompts: -1
debug: 0
asynchronousStartup: 0
remote: 0
killExistingServersOnStart: 1
model:
lora:
contextSize: 512
Expand Down
6 changes: 6 additions & 0 deletions Samples~/ServerClient/ServerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,10 @@ public void CancelRequests()
interaction1.AIReplyComplete();
interaction2.AIReplyComplete();
}

public void ExitGame()
{
Debug.Log("Exit button clicked");
Application.Quit();
}
}
Loading

0 comments on commit c7224b5

Please sign in to comment.