major commit

This commit is contained in:
Rabidus 2023-09-05 17:38:11 +03:00
parent 7d063a5398
commit a4b7b487ff
65 changed files with 4069 additions and 1985 deletions

45
Assets/CutsceneLookAt.cs Normal file
View File

@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CutsceneLookAt : MonoBehaviour
{
[SerializeField]
private float _speed = 5;
private Transform _target;
private bool _started = false;
public Transform Target
{
get
{
if (_target == null)
{
_target = FindObjectOfType<CutsceneLookTarget>().transform;
}
return _target;
}
}
private void Start()
{
_target = FindObjectOfType<CutsceneLookTarget>().transform;
}
public void StartLook()
{
_started = true;
}
void Update()
{
if (!_started)
return;
Vector3 targetDir = _target.position - transform.position;
targetDir.y = 0.0f;
transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.LookRotation(targetDir), Time.time * _speed);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c617f004954f37d4e91211c364270d3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CutsceneLookTarget : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3137139add090094083b9a140296d2db
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -36,7 +36,7 @@ public class DeviceDisconnectController : MonoBehaviour
{ {
StopCoroutine(coroutine); StopCoroutine(coroutine);
coroutine = null; coroutine = null;
Debug.Log("Reconnected.."); UIInfoDisplay.Instance.HideInfo(DisplayMessageType.DeviceLost);
} }
} }
@ -50,7 +50,8 @@ public class DeviceDisconnectController : MonoBehaviour
private IEnumerator DisconnectTime() private IEnumerator DisconnectTime()
{ {
Debug.Log("Disconnected. Wait for Reconnect.."); UIInfoDisplay.Instance.ShowInfo(DisplayMessageType.DeviceLost);
Debug.Log("Íàäåíüòå øëåì");
yield return new WaitForSeconds(15); yield return new WaitForSeconds(15);
OnTotalDisconnect?.Invoke(); OnTotalDisconnect?.Invoke();
} }

View File

@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FinishController : MonoBehaviour
{
private ShipPathFollower _follower;
private CutsceneLookAt _cutsceneLook;
private void Awake()
{
_follower = FindObjectOfType<ShipPathFollower>();
_cutsceneLook = FindObjectOfType<CutsceneLookAt>();
}
public void StartCustcene()
{
_follower.CutsceneMovement();
_cutsceneLook.StartLook();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e0b87dc15c39dc746910256002341c33
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View File

@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 688bc7baa71dcce4b8c97aecfecd05a8
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
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
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 1
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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,477 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &433003143552554490
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 433003143552554493}
- component: {fileID: 433003143552554495}
- component: {fileID: 433003143552554492}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &433003143552554493
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003143552554490}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.0014218877}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 433003144397496766}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.0015869141, y: -0.00592041}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &433003143552554495
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003143552554490}
m_CullTransparentMesh: 1
--- !u!114 &433003143552554492
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003143552554490}
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: 0.32941177, b: 0.3254902, 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: 5949226bb97e777419aa3b6e4a9d7668, type: 3}
m_Type: 3
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 0
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &433003144397496767
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 433003144397496766}
- component: {fileID: 433003144397496739}
- component: {fileID: 433003144397496736}
- component: {fileID: 433003144397496737}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &433003144397496766
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144397496767}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.00047390675}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 433003143552554493}
m_Father: {fileID: 433003144808435163}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -0.0005493164, y: 0.0028686523}
m_SizeDelta: {x: 0, y: 82.75}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &433003144397496739
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144397496767}
m_CullTransparentMesh: 1
--- !u!114 &433003144397496736
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144397496767}
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.624, g: 0.20555297, b: 0.20310591, 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: 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!114 &433003144397496737
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144397496767}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e396294e1a3da4045b6e6d09b47a1751, type: 3}
m_Name:
m_EditorClassIdentifier:
_progressImage: {fileID: 433003143552554492}
_maxValue: 1
_startValue: 1
--- !u!1 &433003144415883738
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 433003144415883741}
- component: {fileID: 433003144415883743}
- component: {fileID: 433003144415883740}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &433003144415883741
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144415883738}
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: 433003144808435163}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 180.8, y: 41.4}
m_SizeDelta: {x: -361.6, y: -82.8}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &433003144415883743
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144415883738}
m_CullTransparentMesh: 1
--- !u!114 &433003144415883740
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144415883738}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text:
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 91.1
m_fontSizeBase: 91.1
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 1
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 15, y: 15, z: 15, w: 15}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &433003144808435160
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 433003144808435163}
- component: {fileID: 433003144808435164}
- component: {fileID: 433003144808435165}
- component: {fileID: 433003144808435162}
m_Layer: 5
m_Name: UIDisplayMessage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &433003144808435163
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144808435160}
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: 433003144397496766}
- {fileID: 433003144415883741}
- {fileID: 4557926110974026247}
m_Father: {fileID: 0}
m_RootOrder: 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: 450}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &433003144808435164
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144808435160}
m_CullTransparentMesh: 1
--- !u!114 &433003144808435165
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144808435160}
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: 0.745, b: 0.745, 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: 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!114 &433003144808435162
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433003144808435160}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: af7beff8720e1524cadf59c242eb8385, type: 3}
m_Name:
m_EditorClassIdentifier:
_textField: {fileID: 433003144415883740}
_progressBar: {fileID: 433003144397496737}
IsShow: 0
--- !u!1 &5858737457362405769
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4557926110974026247}
- component: {fileID: 553026905296240311}
- component: {fileID: 7354669621915195986}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4557926110974026247
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5858737457362405769}
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: 433003144808435163}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 45, y: 38}
m_SizeDelta: {x: 264.09998, y: 264.1}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &553026905296240311
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5858737457362405769}
m_CullTransparentMesh: 1
--- !u!114 &7354669621915195986
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5858737457362405769}
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: 688bc7baa71dcce4b8c97aecfecd05a8, 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

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9ccc701d3c50df748bb7fe2918f18adb
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -2,22 +2,22 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class BoostZone : TriggerZone public class BoostZone : MonoBehaviour
{ {
[SerializeField] [SerializeField]
private float _boostAmmount; private float _boostAmmount;
[SerializeField] [SerializeField]
private float _boostTime; private float _boostTime;
protected override void InZone() private ShipPathFollower _follower;
private void Awake()
{ {
base.InZone(); _follower = FindObjectOfType<ShipPathFollower>();
//_ship.StopBoost();
//_ship.AddBoost(_boostAmmount, _boostTime);
} }
protected override void OutZone() public void UseBoost()
{ {
base.OutZone(); _follower.FastBoost();
} }
} }

View File

@ -14,6 +14,9 @@ public class ShipPathFollower : MonoBehaviour, ITextChangable
public float frictionForce = 0.1f; public float frictionForce = 0.1f;
public float gravityForce = 1f; public float gravityForce = 1f;
public float slopeRange = 60f; public float slopeRange = 60f;
public float cutsceneSpeed = 50f;
[SerializeField] [SerializeField]
private SplineFollower follower; private SplineFollower follower;
public AnimationCurve speedGain; public AnimationCurve speedGain;
@ -35,9 +38,13 @@ public class ShipPathFollower : MonoBehaviour, ITextChangable
public UnityEvent<float> OnSpeedChange; public UnityEvent<float> OnSpeedChange;
private float _boostSpeed;
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
if (_isCutsceneMovement)
return;
if (Input.GetKey(KeyCode.W) || RightTrigger.action.inProgress && LeftTrigger.action.inProgress) if (Input.GetKey(KeyCode.W) || RightTrigger.action.inProgress && LeftTrigger.action.inProgress)
{ {
AddForce(1); AddForce(1);
@ -57,7 +64,11 @@ public class ShipPathFollower : MonoBehaviour, ITextChangable
speedAdd = gravityForce * dotPercent * speedLoss.Evaluate(1f - speedPercent) * Time.deltaTime; speedAdd = gravityForce * dotPercent * speedLoss.Evaluate(1f - speedPercent) * Time.deltaTime;
} }
speed += speedAdd * (1f - brakeForce); speed += speedAdd * (1f - brakeForce);
speed = Mathf.Clamp(speed, minSpeed, maxSpeed);
_boostSpeed -= Time.deltaTime;
_boostSpeed = Mathf.Clamp(_boostSpeed, 0, 50);
speed = Mathf.Clamp(speed, minSpeed, maxSpeed + _boostSpeed);
if (addForce > 0f) if (addForce > 0f)
{ {
float lastAdd = addForce; float lastAdd = addForce;
@ -88,6 +99,12 @@ public class ShipPathFollower : MonoBehaviour, ITextChangable
Debug.Log("fast break"); Debug.Log("fast break");
} }
public void FastBoost()
{
_boostSpeed = 50;
speed += _boostSpeed;
}
public void RemoveBrake() public void RemoveBrake()
{ {
brakeTime = 0f; brakeTime = 0f;
@ -98,4 +115,12 @@ public class ShipPathFollower : MonoBehaviour, ITextChangable
addForce = amount; addForce = amount;
addForce *= RightTrigger.action.ReadValue<float>() * LeftTrigger.action.ReadValue<float>(); addForce *= RightTrigger.action.ReadValue<float>() * LeftTrigger.action.ReadValue<float>();
} }
private bool _isCutsceneMovement = false;
public void CutsceneMovement()
{
_isCutsceneMovement = true;
speed = cutsceneSpeed;
}
} }

File diff suppressed because one or more lines are too long

View File

@ -9,9 +9,48 @@ public class UIDisplayMessage : MonoBehaviour
[SerializeField] [SerializeField]
private UIProgressBar _progressBar; private UIProgressBar _progressBar;
private float _time;
public void Init(DisplayMessage info) public void Init(DisplayMessage info)
{ {
_textField.SetText(info.Message); _textField.SetText(info.Message);
_time = info.Time;
Hide();
}
public bool IsShow = false;
private LTDescr LTDescr;
public void Show()
{
if (IsShow)
{
LeanTween.cancel(LTDescr.id);
LTDescr = LeanTween.value(1, 0, _time).setOnUpdate((float x) =>
{
_progressBar.ChangeValue(x);
}).setOnComplete(Hide);
}
else
{
IsShow = true;
gameObject.SetActive(true);
LTDescr = LeanTween.value(1, 0, _time).setOnUpdate((float x) =>
{
_progressBar.ChangeValue(x);
}).setOnComplete(Hide);
}
}
public void Hide()
{
IsShow = false;
gameObject.SetActive(false);
}
public void StopMessage()
{
Hide();
} }
} }

View File

@ -20,12 +20,11 @@ public class DisplayMessage
public class UIInfoDisplay : MonoBehaviour public class UIInfoDisplay : MonoBehaviour
{ {
public static UIInfoDisplay Instance; public static UIInfoDisplay Instance;
[SerializeField] [SerializeField]
private UITextShow _infoText; private RectTransform _spawnPoint;
[SerializeField] [SerializeField]
private List<DisplayMessage> messages = new List<DisplayMessage>(); private List<DisplayMessage> messages = new List<DisplayMessage>();
public UIDisplayMessage DisplayMessagePrefab; public UIDisplayMessage DisplayMessagePrefab;
private Dictionary<DisplayMessageType, UIDisplayMessage> showedMessages = new Dictionary<DisplayMessageType, UIDisplayMessage>(); private Dictionary<DisplayMessageType, UIDisplayMessage> showedMessages = new Dictionary<DisplayMessageType, UIDisplayMessage>();
@ -42,20 +41,40 @@ public class UIInfoDisplay : MonoBehaviour
} }
} }
public void ShowInfo(DisplayMessageType type) private void Start()
{ {
var selected = messages.Find(x => x.Type == type); InitMessages();
if (!showedMessages.ContainsKey(type))
{
} }
_infoText.SetText(selected.Message); private void InitMessages()
{
foreach (var message in messages)
{
var newMessage = Instantiate(DisplayMessagePrefab, _spawnPoint);
newMessage.Init(message);
showedMessages.Add(message.Type, newMessage);
}
}
[ContextMenu("Debug show")]
private void DebugShow()
{
ShowInfo(DisplayMessageType.DeviceLost);
}
[ContextMenu("Debug hide")]
private void DebugHide()
{
HideInfo(DisplayMessageType.DeviceLost);
}
public void ShowInfo(DisplayMessageType type)
{
showedMessages[type].Show();
} }
public void HideInfo(DisplayMessageType type) public void HideInfo(DisplayMessageType type)
{ {
showedMessages[type].Hide();
} }
} }