forked from cgvr/DeltaVR
Compare commits
3 Commits
d0b909a1ab
...
c07fb1fe1e
| Author | SHA1 | Date | |
|---|---|---|---|
| c07fb1fe1e | |||
| cf709f4dc9 | |||
| 3d804dfdaf |
@@ -6,7 +6,6 @@
|
|||||||
* archery range:
|
* archery range:
|
||||||
* kui midagi laeb (wire aktiivne), siis particle'id võiks voolata mööda toru
|
* kui midagi laeb (wire aktiivne), siis particle'id võiks voolata mööda toru
|
||||||
* highscore json tühjaks
|
* highscore json tühjaks
|
||||||
* quest marker järjest järgmise tegevuse kohal: mikrofon, siis nupud
|
|
||||||
* npc character:
|
* npc character:
|
||||||
* klaas on näha temast eespool
|
* klaas on näha temast eespool
|
||||||
* voicelines: list listidest, mille hulgast saab valida
|
* voicelines: list listidest, mille hulgast saab valida
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class ArcheryRange : NetworkBehaviour
|
|||||||
public Transform targetEndPosition;
|
public Transform targetEndPosition;
|
||||||
public GameObject targetPrefab;
|
public GameObject targetPrefab;
|
||||||
public StartTarget startTarget;
|
public StartTarget startTarget;
|
||||||
|
public QuestMarker questMarker;
|
||||||
|
|
||||||
public GameObject archeryTargetPointsText;
|
public GameObject archeryTargetPointsText;
|
||||||
|
|
||||||
@@ -210,6 +211,8 @@ public class ArcheryRange : NetworkBehaviour
|
|||||||
_roundEndTime = Time.time + roundLength;
|
_roundEndTime = Time.time + roundLength;
|
||||||
_nextTargetTime = Time.time;
|
_nextTargetTime = Time.time;
|
||||||
_roundActive = true;
|
_roundActive = true;
|
||||||
|
|
||||||
|
questMarker.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddScore(float distance)
|
public void AddScore(float distance)
|
||||||
|
|||||||
BIN
Assets/_PROJECT/Images/quest_marker.png
LFS
Normal file
BIN
Assets/_PROJECT/Images/quest_marker.png
LFS
Normal file
Binary file not shown.
148
Assets/_PROJECT/Images/quest_marker.png.meta
Normal file
148
Assets/_PROJECT/Images/quest_marker.png.meta
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 59908f70ddcc6fa4db000ffac24a2087
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
flipGreenChannel: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
vTOnly: 0
|
||||||
|
ignoreMipmapLimit: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 0
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
swizzle: 50462976
|
||||||
|
cookieLightType: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: WebGL
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Windows Store Apps
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable: {}
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
218
Assets/_PROJECT/Prefabs/ModelGeneration/QuestMarker.prefab
Normal file
218
Assets/_PROJECT/Prefabs/ModelGeneration/QuestMarker.prefab
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &7323203251096755498
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 3797719421990378173}
|
||||||
|
- component: {fileID: 291116454904825960}
|
||||||
|
- component: {fileID: 2165083730513482807}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Image
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &3797719421990378173
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7323203251096755498}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 0.003, y: 0.003, z: 0.003}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 6636101193752595590}
|
||||||
|
m_RootOrder: -1
|
||||||
|
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: 0}
|
||||||
|
m_SizeDelta: {x: 30, y: 120}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &291116454904825960
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7323203251096755498}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &2165083730513482807
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7323203251096755498}
|
||||||
|
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: 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_Sprite: {fileID: 21300000, guid: 59908f70ddcc6fa4db000ffac24a2087, type: 3}
|
||||||
|
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!1 &9102016930920446162
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6636101193752595590}
|
||||||
|
- component: {fileID: 6091855950810912767}
|
||||||
|
- component: {fileID: 6596219281253672973}
|
||||||
|
- component: {fileID: 7614556523030537149}
|
||||||
|
- component: {fileID: 2337825811759150745}
|
||||||
|
- component: {fileID: 7657039507371642839}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: QuestMarker
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &6636101193752595590
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9102016930920446162}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: -3.155}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 3797719421990378173}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: -1
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
|
m_AnchoredPosition: {x: 0.988, y: 0.485}
|
||||||
|
m_SizeDelta: {x: 30, y: 120}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!223 &6091855950810912767
|
||||||
|
Canvas:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9102016930920446162}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_RenderMode: 2
|
||||||
|
m_Camera: {fileID: 0}
|
||||||
|
m_PlaneDistance: 100
|
||||||
|
m_PixelPerfect: 0
|
||||||
|
m_ReceivesEvents: 1
|
||||||
|
m_OverrideSorting: 0
|
||||||
|
m_OverridePixelPerfect: 0
|
||||||
|
m_SortingBucketNormalizedSize: 0
|
||||||
|
m_AdditionalShaderChannelsFlag: 0
|
||||||
|
m_UpdateRectTransformForStandalone: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_TargetDisplay: 0
|
||||||
|
--- !u!114 &6596219281253672973
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9102016930920446162}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_UiScaleMode: 0
|
||||||
|
m_ReferencePixelsPerUnit: 100
|
||||||
|
m_ScaleFactor: 1
|
||||||
|
m_ReferenceResolution: {x: 800, y: 600}
|
||||||
|
m_ScreenMatchMode: 0
|
||||||
|
m_MatchWidthOrHeight: 0
|
||||||
|
m_PhysicalUnit: 3
|
||||||
|
m_FallbackScreenDPI: 96
|
||||||
|
m_DefaultSpriteDPI: 96
|
||||||
|
m_DynamicPixelsPerUnit: 1
|
||||||
|
m_PresetInfoIsWorld: 1
|
||||||
|
--- !u!114 &7614556523030537149
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9102016930920446162}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_IgnoreReversedGraphics: 1
|
||||||
|
m_BlockingObjects: 0
|
||||||
|
m_BlockingMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
--- !u!114 &2337825811759150745
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9102016930920446162}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 146b6814753582e479a1893e2736b683, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
movingPart: {fileID: 3797719421990378173}
|
||||||
|
amplitude: 0.1
|
||||||
|
frequency: 1.5
|
||||||
|
--- !u!65 &7657039507371642839
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9102016930920446162}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_IsTrigger: 1
|
||||||
|
m_ProvidesContacts: 0
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_Size: {x: 10, y: 4, z: 10}
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5a2602f5b7a2e454b8d2438d69ef1a89
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -7,11 +7,13 @@ using System.Threading.Tasks;
|
|||||||
public class ArcheryRangeNPC : NPCController
|
public class ArcheryRangeNPC : NPCController
|
||||||
{
|
{
|
||||||
[Header("Archery Range Config")]
|
[Header("Archery Range Config")]
|
||||||
|
public QuestMarker questMarker;
|
||||||
public MicrophoneStand microphoneStand;
|
public MicrophoneStand microphoneStand;
|
||||||
public PushableButton imageGenerationButton;
|
public PushableButton imageGenerationButton;
|
||||||
public PushableButton modelGenerationButton;
|
public PushableButton modelGenerationButton;
|
||||||
public Image imageDisplay;
|
public Image imageDisplay;
|
||||||
public ModelDisplay modelDisplay;
|
public ModelDisplay modelDisplay;
|
||||||
|
public Transform startTarget;
|
||||||
|
|
||||||
private Texture2D GeneratedTexture;
|
private Texture2D GeneratedTexture;
|
||||||
private EventInstance printingSound;
|
private EventInstance printingSound;
|
||||||
@@ -44,11 +46,14 @@ public class ArcheryRangeNPC : NPCController
|
|||||||
{
|
{
|
||||||
if (state == 0)
|
if (state == 0)
|
||||||
{
|
{
|
||||||
|
questMarker.gameObject.SetActive(false);
|
||||||
SpeakVoiceLine(0);
|
SpeakVoiceLine(0);
|
||||||
await Task.Delay(2000);
|
await Task.Delay(2000);
|
||||||
SpeakVoiceLine(1);
|
SpeakVoiceLine(1);
|
||||||
await Task.Delay(6500);
|
await Task.Delay(6500);
|
||||||
SpeakVoiceLine(2);
|
SpeakVoiceLine(2);
|
||||||
|
questMarker.gameObject.SetActive(true);
|
||||||
|
questMarker.MoveTo(microphoneStand.transform);
|
||||||
await Task.Delay(3000);
|
await Task.Delay(3000);
|
||||||
|
|
||||||
state = 1;
|
state = 1;
|
||||||
@@ -65,6 +70,7 @@ public class ArcheryRangeNPC : NPCController
|
|||||||
if (state == 1)
|
if (state == 1)
|
||||||
{
|
{
|
||||||
SpeakVoiceLine(3);
|
SpeakVoiceLine(3);
|
||||||
|
questMarker.MoveTo(imageGenerationButton.transform);
|
||||||
state = 2;
|
state = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,6 +93,7 @@ public class ArcheryRangeNPC : NPCController
|
|||||||
{
|
{
|
||||||
modelGenerationButton.Deactivate();
|
modelGenerationButton.Deactivate();
|
||||||
SpeakVoiceLine(4);
|
SpeakVoiceLine(4);
|
||||||
|
questMarker.MoveTo(modelGenerationButton.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +116,7 @@ public class ArcheryRangeNPC : NPCController
|
|||||||
if (state == 4)
|
if (state == 4)
|
||||||
{
|
{
|
||||||
SpeakVoiceLine(5);
|
SpeakVoiceLine(5);
|
||||||
|
questMarker.MoveTo(startTarget);
|
||||||
state = 5;
|
state = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ using UnityEngine.UI;
|
|||||||
public class ShapeDetectionNPC : NPCController
|
public class ShapeDetectionNPC : NPCController
|
||||||
{
|
{
|
||||||
[Header("Shape Detection Minigame Config")]
|
[Header("Shape Detection Minigame Config")]
|
||||||
|
public QuestMarker questMarker;
|
||||||
public MicrophoneStand microphoneStand;
|
public MicrophoneStand microphoneStand;
|
||||||
public RadioTransmitter radio;
|
public RadioTransmitter radio;
|
||||||
public PushableButton imageGenerationButton;
|
public PushableButton imageGenerationButton;
|
||||||
public PushableButton modelGenerationButton;
|
public PushableButton modelGenerationButton;
|
||||||
public Texture2D GeneratedTexture { get; private set; }
|
public Texture2D GeneratedTexture { get; private set; }
|
||||||
public Image imageDisplay;
|
public Image imageDisplay;
|
||||||
|
public ShapeScanner shapeScanner;
|
||||||
|
|
||||||
public GameObject GeneratedModel { get; private set; }
|
public GameObject GeneratedModel { get; private set; }
|
||||||
public Transform modelSpawnPoint;
|
public Transform modelSpawnPoint;
|
||||||
@@ -55,6 +57,8 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
{
|
{
|
||||||
state = 1;
|
state = 1;
|
||||||
await CallPlayer();
|
await CallPlayer();
|
||||||
|
await Task.Delay(2500);
|
||||||
|
questMarker.MoveTo(radio.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,12 +86,14 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPlayerPickedUpRadio()
|
private async void OnPlayerPickedUpRadio()
|
||||||
{
|
{
|
||||||
if (state == 1)
|
if (state == 1)
|
||||||
{
|
{
|
||||||
SpeakVoiceLine(2);
|
SpeakVoiceLine(2);
|
||||||
state = 2;
|
state = 2;
|
||||||
|
await Task.Delay(5000);
|
||||||
|
questMarker.MoveTo(microphoneStand.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,17 +104,12 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
{
|
{
|
||||||
SpeakVoiceLine(3);
|
SpeakVoiceLine(3);
|
||||||
state = 3;
|
state = 3;
|
||||||
|
questMarker.MoveTo(imageGenerationButton.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnPlayerPressedKeyboard()
|
private async void OnPlayerPressedKeyboard()
|
||||||
{
|
{
|
||||||
if (state == 3)
|
|
||||||
{
|
|
||||||
SpeakVoiceLine(4);
|
|
||||||
state = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
string inputPrompt = microphoneStand.GetTextOutput();
|
string inputPrompt = microphoneStand.GetTextOutput();
|
||||||
byte[] imageBytes = await InvokeAiClient.Instance.GenerateImage(inputPrompt);
|
byte[] imageBytes = await InvokeAiClient.Instance.GenerateImage(inputPrompt);
|
||||||
GeneratedTexture = ModelGenerationUtils.CreateTexture(imageBytes);
|
GeneratedTexture = ModelGenerationUtils.CreateTexture(imageBytes);
|
||||||
@@ -116,8 +117,11 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
imageDisplay.sprite = sprite;
|
imageDisplay.sprite = sprite;
|
||||||
|
|
||||||
imageGenerationButton.Deactivate();
|
imageGenerationButton.Deactivate();
|
||||||
if (state == 4)
|
if (state == 3)
|
||||||
{
|
{
|
||||||
|
SpeakVoiceLine(4);
|
||||||
|
state = 4;
|
||||||
|
questMarker.MoveTo(modelGenerationButton.transform);
|
||||||
modelGenerationButton.Deactivate();
|
modelGenerationButton.Deactivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,6 +132,7 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
{
|
{
|
||||||
SpeakVoiceLine(5);
|
SpeakVoiceLine(5);
|
||||||
state = 5;
|
state = 5;
|
||||||
|
questMarker.MoveTo(shapeScanner.transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
string encodedTexture = Convert.ToBase64String(GeneratedTexture.EncodeToJPG());
|
string encodedTexture = Convert.ToBase64String(GeneratedTexture.EncodeToJPG());
|
||||||
|
|||||||
56
Assets/_PROJECT/Scripts/ModeGeneration/QuestMarker.cs
Normal file
56
Assets/_PROJECT/Scripts/ModeGeneration/QuestMarker.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class QuestMarker : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Transform movingPart;
|
||||||
|
public float amplitude = 0.1f; // How far up/down it moves
|
||||||
|
public float frequency = 1.5f; // Speed of oscillation
|
||||||
|
public float heightAboveTarget = 1f;
|
||||||
|
|
||||||
|
private Vector3 startPos;
|
||||||
|
private Transform playerTransform;
|
||||||
|
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
startPos = movingPart.localPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
// Float up and down
|
||||||
|
float offset = Mathf.Sin(Time.time * frequency) * amplitude;
|
||||||
|
movingPart.localPosition = startPos + new Vector3(0f, offset, 0f);
|
||||||
|
|
||||||
|
if (playerTransform != null)
|
||||||
|
{
|
||||||
|
// Turn towards player
|
||||||
|
Vector3 lookTargetPos = new Vector3(playerTransform.position.x, transform.position.y, playerTransform.position.z);
|
||||||
|
transform.LookAt(lookTargetPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTriggerEnter(Collider other)
|
||||||
|
{
|
||||||
|
if (other.gameObject.tag == "Player Head")
|
||||||
|
{
|
||||||
|
playerTransform = other.transform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTriggerExit(Collider other)
|
||||||
|
{
|
||||||
|
if (other.gameObject.tag == "Player Head")
|
||||||
|
{
|
||||||
|
playerTransform = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void MoveTo(Transform target)
|
||||||
|
{
|
||||||
|
transform.position = target.position + new Vector3(0, heightAboveTarget, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/_PROJECT/Scripts/ModeGeneration/QuestMarker.cs.meta
Normal file
11
Assets/_PROJECT/Scripts/ModeGeneration/QuestMarker.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 146b6814753582e479a1893e2736b683
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Reference in New Issue
Block a user