pull/2/head
sangta 2024-06-24 09:17:43 +07:00
parent 02ba8dd4cf
commit 00584231a5
23 changed files with 6351 additions and 1457 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ using GadGame.Network;
namespace GadGame.Scripts
{
[RequireComponent(typeof(RawImage))]
[RequireComponent(typeof(Image))]
public class LoadImageEncoded : MonoBehaviour
{
[SerializeField] private bool _preserveAspect;

View File

@ -15,6 +15,15 @@ namespace GadGame.Manager
_transitionCanvasGroup.alpha = 0;
}
public async UniTask LoadSceneAsync(string scenePath)
{
var asyncOperation = SceneManager.LoadSceneAsync(scenePath);
asyncOperation.allowSceneActivation = false;
await UniTask.WaitUntil(() => asyncOperation.progress >= 0.9f);
asyncOperation.allowSceneActivation = true;
}
public async void LoadSceneWithTransition(int sceneIndex, float transitionDuration = 1)
{
await _transitionCanvasGroup.DOFade(1, transitionDuration).SetUpdate(true);

View File

@ -14,14 +14,7 @@ namespace GadGame.State.MainFlowState
public override async void Enter()
{
if(UdpSocket.Instance.DataReceived.Gender < 0.5f)
{
await LoadSceneManager.Instance.LoadSceneWithTransitionAsync(Runner.SceneFlowConfig.CTASceneMale.ScenePath);
} else
{
await LoadSceneManager.Instance.LoadSceneWithTransitionAsync(Runner.SceneFlowConfig.CTASceneFemale.ScenePath);
}
await LoadSceneManager.Instance.LoadSceneAsync(Runner.SceneFlowConfig.CTASceneMale.ScenePath);
Runner.ScanSuccess.Register(OnScanSuccess);
_leaveTimer = 0;
@ -29,6 +22,7 @@ namespace GadGame.State.MainFlowState
public override void Update(float time)
{
Runner.EncodeImage.Raise(UdpSocket.Instance.DataReceived.StreamingData);
if(_scanSuccess) return;
if (!UdpSocket.Instance.DataReceived.Engage)
{

View File

@ -12,6 +12,10 @@ namespace GadGame.State.MainFlowState
public override void Update(float time)
{
Runner.EncodeImage.Raise(UdpSocket.Instance.DataReceived.StreamingData);
if (time > 3.0f)
{
Runner.SetState<CTAState>();
}
}
public override void Exit()

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 KiB

View File

@ -0,0 +1,140 @@
fileFormatVersion: 2
guid: 465fe24a672f1304aa7d4cb50e8106e6
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
ignorePlatformSupport: 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
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 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
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 1537655665
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -42,9 +42,9 @@ MonoBehaviour:
_isDirty: 0
_scenePath: Assets/GadGame/Scenes/GameFemale.unity
CTASceneMale:
_sceneAsset: {fileID: 102900000, guid: 8d29c734954a82da488afe07def90528, type: 3}
_sceneAsset: {fileID: 102900000, guid: 88e348cabc0748dbc8129f71b4cb9390, type: 3}
_isDirty: 0
_scenePath: Assets/GadGame/Scenes/CTA-male.unity
_scenePath: Assets/GadGame/Scenes/CTA.unity
CTASceneFemale:
_sceneAsset: {fileID: 102900000, guid: 4ecb64fb1fa29a71fa49c5a3bc530eb7, type: 3}
_isDirty: 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -53,4 +53,7 @@ EditorBuildSettings:
- enabled: 1
path: Assets/GadGame/Scenes/PassBy_coffee.unity
guid: b0e1447ef6499864c9eed0c52d576102
- enabled: 1
path: Assets/GadGame/Scenes/CTA.unity
guid: 88e348cabc0748dbc8129f71b4cb9390
m_configObjects: {}