com.typhoon.unitysdk 1.0.23 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Runtime/GUIMessageBox.cs +129 -0
- package/Runtime/GUIMessageBox.cs.meta +11 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_BLACK.png +0 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_BLACK.png.meta +96 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_BLACK_ALPHA.png +0 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_BLACK_ALPHA.png.meta +144 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_GREEN_ALPHA.png +0 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_GREEN_ALPHA.png.meta +144 -0
- package/Runtime/SimulateRecordGame.cs +2 -126
- package/Sources~/Package/Douyin.unitypackage +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
using System;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace TyphoonUnitySDK
|
|
6
|
+
{
|
|
7
|
+
public class GUIMessageBox : MonoSingleton<GUIMessageBox>
|
|
8
|
+
{
|
|
9
|
+
private const float HOLD_TIME = 1.3F;
|
|
10
|
+
public bool IsShow = false;
|
|
11
|
+
public string Content;
|
|
12
|
+
public string TxtYes;
|
|
13
|
+
public string TxtNo;
|
|
14
|
+
private Texture _black;
|
|
15
|
+
private Texture _green;
|
|
16
|
+
private float _holdTimeYes;
|
|
17
|
+
private float _holdTimeNo;
|
|
18
|
+
private GUIStyle _labelStyle = null;
|
|
19
|
+
private Action _onYes;
|
|
20
|
+
private Action _onNo;
|
|
21
|
+
|
|
22
|
+
private GUIStyle LabelStyle
|
|
23
|
+
{
|
|
24
|
+
get
|
|
25
|
+
{
|
|
26
|
+
if (_labelStyle == null)
|
|
27
|
+
{
|
|
28
|
+
_labelStyle = GUI.skin.label;
|
|
29
|
+
_labelStyle.fontSize = 32;
|
|
30
|
+
_labelStyle.fontStyle = FontStyle.Bold;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return _labelStyle;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
protected override void Init()
|
|
39
|
+
{
|
|
40
|
+
base.Init();
|
|
41
|
+
DontDestroyOnLoad(gameObject);
|
|
42
|
+
_black = Resources.Load<Texture>("TYPHOON_TEXTURE_TOAST_BLACK");
|
|
43
|
+
_green = Resources.Load<Texture>("TYPHOON_TEXTURE_TOAST_GREEN_ALPHA");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public void Show(string content, string txtYes = "是", string txtNo = "否", Action success = null,
|
|
47
|
+
Action fail = null)
|
|
48
|
+
{
|
|
49
|
+
_onYes = success;
|
|
50
|
+
_onNo = fail;
|
|
51
|
+
Content = content;
|
|
52
|
+
TxtYes = txtYes;
|
|
53
|
+
TxtNo = txtNo;
|
|
54
|
+
IsShow = true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private void OnGUI()
|
|
58
|
+
{
|
|
59
|
+
if (IsShow)
|
|
60
|
+
{
|
|
61
|
+
var rect = new Rect(0, 0, Screen.width, Screen.height);
|
|
62
|
+
var rectContent = rect;
|
|
63
|
+
rectContent.width = rect.width * 0.8f;
|
|
64
|
+
rectContent.height = Mathf.Min(rect.height * 0.3f, 260);
|
|
65
|
+
rectContent.center = rect.center;
|
|
66
|
+
rectContent.y -= rectContent.height * 0.5f;
|
|
67
|
+
rectContent.y -= 20;
|
|
68
|
+
DrawLabel(rectContent, Content);
|
|
69
|
+
var rectYes = rectContent;
|
|
70
|
+
rectYes.width = rectContent.width * 0.5f - 20;
|
|
71
|
+
rectYes.height = rectContent.height * 0.5f;
|
|
72
|
+
rectYes.y = rect.center.y + 20;
|
|
73
|
+
rectYes.x = rect.center.x + 20;
|
|
74
|
+
var rectNo = rectYes;
|
|
75
|
+
rectNo.x = rect.center.x - rectNo.width - 20;
|
|
76
|
+
DrawLabel(rectYes, TxtYes);
|
|
77
|
+
DrawLabel(rectNo, TxtNo);
|
|
78
|
+
HoldHide(rectYes, ref _holdTimeYes, () =>
|
|
79
|
+
{
|
|
80
|
+
_onYes?.Invoke();
|
|
81
|
+
IsShow = false;
|
|
82
|
+
});
|
|
83
|
+
HoldHide(rectNo, ref _holdTimeNo, () =>
|
|
84
|
+
{
|
|
85
|
+
_onNo?.Invoke();
|
|
86
|
+
IsShow = false;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private void DrawLabel(Rect rect, string content, TextAnchor anchor = TextAnchor.MiddleCenter,
|
|
92
|
+
int fontSize = 32)
|
|
93
|
+
{
|
|
94
|
+
GUI.DrawTexture(rect, _black, ScaleMode.StretchToFill, true);
|
|
95
|
+
LabelStyle.alignment = anchor;
|
|
96
|
+
LabelStyle.fontSize = fontSize;
|
|
97
|
+
GUI.Label(rect, content, LabelStyle);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
private void HoldHide(Rect rectClose, ref float holdTime, Action hideHandler)
|
|
102
|
+
{
|
|
103
|
+
var inside = rectClose.Contains(Event.current.mousePosition);
|
|
104
|
+
if (inside && Event.current.delta == Vector2.zero)
|
|
105
|
+
{
|
|
106
|
+
holdTime += Time.unscaledDeltaTime;
|
|
107
|
+
var process = Mathf.Clamp01(holdTime / HOLD_TIME);
|
|
108
|
+
var rectProcess = rectClose;
|
|
109
|
+
rectProcess.width *= process;
|
|
110
|
+
GUI.DrawTexture(rectProcess, _green, ScaleMode.StretchToFill, true);
|
|
111
|
+
if (process >= 1)
|
|
112
|
+
{
|
|
113
|
+
hideHandler?.Invoke();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else
|
|
117
|
+
{
|
|
118
|
+
holdTime = 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (inside && Event.current.type == EventType.MouseDown)
|
|
122
|
+
{
|
|
123
|
+
hideHandler?.Invoke();
|
|
124
|
+
Event.current.Use();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
#endif
|
|
Binary file
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: d8f62bc650e259a42b06cf4c7f1c8aef
|
|
3
|
+
TextureImporter:
|
|
4
|
+
internalIDToNameTable: []
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 11
|
|
7
|
+
mipmaps:
|
|
8
|
+
mipMapMode: 0
|
|
9
|
+
enableMipMap: 1
|
|
10
|
+
sRGBTexture: 1
|
|
11
|
+
linearTexture: 0
|
|
12
|
+
fadeOut: 0
|
|
13
|
+
borderMipMap: 0
|
|
14
|
+
mipMapsPreserveCoverage: 0
|
|
15
|
+
alphaTestReferenceValue: 0.5
|
|
16
|
+
mipMapFadeDistanceStart: 1
|
|
17
|
+
mipMapFadeDistanceEnd: 3
|
|
18
|
+
bumpmap:
|
|
19
|
+
convertToNormalMap: 0
|
|
20
|
+
externalNormalMap: 0
|
|
21
|
+
heightScale: 0.25
|
|
22
|
+
normalMapFilter: 0
|
|
23
|
+
isReadable: 0
|
|
24
|
+
streamingMipmaps: 0
|
|
25
|
+
streamingMipmapsPriority: 0
|
|
26
|
+
vTOnly: 0
|
|
27
|
+
grayScaleToAlpha: 0
|
|
28
|
+
generateCubemap: 6
|
|
29
|
+
cubemapConvolution: 0
|
|
30
|
+
seamlessCubemap: 0
|
|
31
|
+
textureFormat: 1
|
|
32
|
+
maxTextureSize: 2048
|
|
33
|
+
textureSettings:
|
|
34
|
+
serializedVersion: 2
|
|
35
|
+
filterMode: 1
|
|
36
|
+
aniso: 1
|
|
37
|
+
mipBias: 0
|
|
38
|
+
wrapU: 0
|
|
39
|
+
wrapV: 0
|
|
40
|
+
wrapW: 0
|
|
41
|
+
nPOTScale: 1
|
|
42
|
+
lightmap: 0
|
|
43
|
+
compressionQuality: 50
|
|
44
|
+
spriteMode: 0
|
|
45
|
+
spriteExtrude: 1
|
|
46
|
+
spriteMeshType: 1
|
|
47
|
+
alignment: 0
|
|
48
|
+
spritePivot: {x: 0.5, y: 0.5}
|
|
49
|
+
spritePixelsToUnits: 100
|
|
50
|
+
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
51
|
+
spriteGenerateFallbackPhysicsShape: 1
|
|
52
|
+
alphaUsage: 1
|
|
53
|
+
alphaIsTransparency: 0
|
|
54
|
+
spriteTessellationDetail: -1
|
|
55
|
+
textureType: 0
|
|
56
|
+
textureShape: 1
|
|
57
|
+
singleChannelComponent: 0
|
|
58
|
+
flipbookRows: 1
|
|
59
|
+
flipbookColumns: 1
|
|
60
|
+
maxTextureSizeSet: 0
|
|
61
|
+
compressionQualitySet: 0
|
|
62
|
+
textureFormatSet: 0
|
|
63
|
+
ignorePngGamma: 0
|
|
64
|
+
applyGammaDecoding: 0
|
|
65
|
+
platformSettings:
|
|
66
|
+
- serializedVersion: 3
|
|
67
|
+
buildTarget: DefaultTexturePlatform
|
|
68
|
+
maxTextureSize: 2048
|
|
69
|
+
resizeAlgorithm: 0
|
|
70
|
+
textureFormat: -1
|
|
71
|
+
textureCompression: 1
|
|
72
|
+
compressionQuality: 50
|
|
73
|
+
crunchedCompression: 0
|
|
74
|
+
allowsAlphaSplitting: 0
|
|
75
|
+
overridden: 0
|
|
76
|
+
androidETC2FallbackOverride: 0
|
|
77
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
78
|
+
spriteSheet:
|
|
79
|
+
serializedVersion: 2
|
|
80
|
+
sprites: []
|
|
81
|
+
outline: []
|
|
82
|
+
physicsShape: []
|
|
83
|
+
bones: []
|
|
84
|
+
spriteID:
|
|
85
|
+
internalID: 0
|
|
86
|
+
vertices: []
|
|
87
|
+
indices:
|
|
88
|
+
edges: []
|
|
89
|
+
weights: []
|
|
90
|
+
secondaryTextures: []
|
|
91
|
+
spritePackingTag:
|
|
92
|
+
pSDRemoveMatte: 0
|
|
93
|
+
pSDShowRemoveMatteOption: 0
|
|
94
|
+
userData:
|
|
95
|
+
assetBundleName:
|
|
96
|
+
assetBundleVariant:
|
|
Binary file
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e707b1f4d89ec074fa368d77d9b21f14
|
|
3
|
+
TextureImporter:
|
|
4
|
+
internalIDToNameTable: []
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 11
|
|
7
|
+
mipmaps:
|
|
8
|
+
mipMapMode: 0
|
|
9
|
+
enableMipMap: 1
|
|
10
|
+
sRGBTexture: 1
|
|
11
|
+
linearTexture: 0
|
|
12
|
+
fadeOut: 0
|
|
13
|
+
borderMipMap: 0
|
|
14
|
+
mipMapsPreserveCoverage: 0
|
|
15
|
+
alphaTestReferenceValue: 0.5
|
|
16
|
+
mipMapFadeDistanceStart: 1
|
|
17
|
+
mipMapFadeDistanceEnd: 3
|
|
18
|
+
bumpmap:
|
|
19
|
+
convertToNormalMap: 0
|
|
20
|
+
externalNormalMap: 0
|
|
21
|
+
heightScale: 0.25
|
|
22
|
+
normalMapFilter: 0
|
|
23
|
+
isReadable: 0
|
|
24
|
+
streamingMipmaps: 0
|
|
25
|
+
streamingMipmapsPriority: 0
|
|
26
|
+
vTOnly: 0
|
|
27
|
+
grayScaleToAlpha: 0
|
|
28
|
+
generateCubemap: 6
|
|
29
|
+
cubemapConvolution: 0
|
|
30
|
+
seamlessCubemap: 0
|
|
31
|
+
textureFormat: 1
|
|
32
|
+
maxTextureSize: 2048
|
|
33
|
+
textureSettings:
|
|
34
|
+
serializedVersion: 2
|
|
35
|
+
filterMode: 1
|
|
36
|
+
aniso: 1
|
|
37
|
+
mipBias: 0
|
|
38
|
+
wrapU: 0
|
|
39
|
+
wrapV: 0
|
|
40
|
+
wrapW: 0
|
|
41
|
+
nPOTScale: 1
|
|
42
|
+
lightmap: 0
|
|
43
|
+
compressionQuality: 50
|
|
44
|
+
spriteMode: 0
|
|
45
|
+
spriteExtrude: 1
|
|
46
|
+
spriteMeshType: 1
|
|
47
|
+
alignment: 0
|
|
48
|
+
spritePivot: {x: 0.5, y: 0.5}
|
|
49
|
+
spritePixelsToUnits: 100
|
|
50
|
+
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
51
|
+
spriteGenerateFallbackPhysicsShape: 1
|
|
52
|
+
alphaUsage: 1
|
|
53
|
+
alphaIsTransparency: 1
|
|
54
|
+
spriteTessellationDetail: -1
|
|
55
|
+
textureType: 0
|
|
56
|
+
textureShape: 1
|
|
57
|
+
singleChannelComponent: 0
|
|
58
|
+
flipbookRows: 1
|
|
59
|
+
flipbookColumns: 1
|
|
60
|
+
maxTextureSizeSet: 0
|
|
61
|
+
compressionQualitySet: 0
|
|
62
|
+
textureFormatSet: 0
|
|
63
|
+
ignorePngGamma: 0
|
|
64
|
+
applyGammaDecoding: 0
|
|
65
|
+
platformSettings:
|
|
66
|
+
- serializedVersion: 3
|
|
67
|
+
buildTarget: DefaultTexturePlatform
|
|
68
|
+
maxTextureSize: 2048
|
|
69
|
+
resizeAlgorithm: 0
|
|
70
|
+
textureFormat: -1
|
|
71
|
+
textureCompression: 1
|
|
72
|
+
compressionQuality: 50
|
|
73
|
+
crunchedCompression: 0
|
|
74
|
+
allowsAlphaSplitting: 0
|
|
75
|
+
overridden: 0
|
|
76
|
+
androidETC2FallbackOverride: 0
|
|
77
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
78
|
+
- serializedVersion: 3
|
|
79
|
+
buildTarget: Standalone
|
|
80
|
+
maxTextureSize: 2048
|
|
81
|
+
resizeAlgorithm: 0
|
|
82
|
+
textureFormat: -1
|
|
83
|
+
textureCompression: 1
|
|
84
|
+
compressionQuality: 50
|
|
85
|
+
crunchedCompression: 0
|
|
86
|
+
allowsAlphaSplitting: 0
|
|
87
|
+
overridden: 0
|
|
88
|
+
androidETC2FallbackOverride: 0
|
|
89
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
90
|
+
- serializedVersion: 3
|
|
91
|
+
buildTarget: iPhone
|
|
92
|
+
maxTextureSize: 2048
|
|
93
|
+
resizeAlgorithm: 0
|
|
94
|
+
textureFormat: -1
|
|
95
|
+
textureCompression: 1
|
|
96
|
+
compressionQuality: 50
|
|
97
|
+
crunchedCompression: 0
|
|
98
|
+
allowsAlphaSplitting: 0
|
|
99
|
+
overridden: 0
|
|
100
|
+
androidETC2FallbackOverride: 0
|
|
101
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
102
|
+
- serializedVersion: 3
|
|
103
|
+
buildTarget: WebGL
|
|
104
|
+
maxTextureSize: 2048
|
|
105
|
+
resizeAlgorithm: 0
|
|
106
|
+
textureFormat: -1
|
|
107
|
+
textureCompression: 1
|
|
108
|
+
compressionQuality: 50
|
|
109
|
+
crunchedCompression: 0
|
|
110
|
+
allowsAlphaSplitting: 0
|
|
111
|
+
overridden: 0
|
|
112
|
+
androidETC2FallbackOverride: 0
|
|
113
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
114
|
+
- serializedVersion: 3
|
|
115
|
+
buildTarget: Android
|
|
116
|
+
maxTextureSize: 2048
|
|
117
|
+
resizeAlgorithm: 0
|
|
118
|
+
textureFormat: -1
|
|
119
|
+
textureCompression: 1
|
|
120
|
+
compressionQuality: 50
|
|
121
|
+
crunchedCompression: 0
|
|
122
|
+
allowsAlphaSplitting: 0
|
|
123
|
+
overridden: 0
|
|
124
|
+
androidETC2FallbackOverride: 0
|
|
125
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
126
|
+
spriteSheet:
|
|
127
|
+
serializedVersion: 2
|
|
128
|
+
sprites: []
|
|
129
|
+
outline: []
|
|
130
|
+
physicsShape: []
|
|
131
|
+
bones: []
|
|
132
|
+
spriteID:
|
|
133
|
+
internalID: 0
|
|
134
|
+
vertices: []
|
|
135
|
+
indices:
|
|
136
|
+
edges: []
|
|
137
|
+
weights: []
|
|
138
|
+
secondaryTextures: []
|
|
139
|
+
spritePackingTag:
|
|
140
|
+
pSDRemoveMatte: 0
|
|
141
|
+
pSDShowRemoveMatteOption: 0
|
|
142
|
+
userData:
|
|
143
|
+
assetBundleName:
|
|
144
|
+
assetBundleVariant:
|
|
Binary file
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 01ab6d066fda9ae4ab539f69e9f9c0df
|
|
3
|
+
TextureImporter:
|
|
4
|
+
internalIDToNameTable: []
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 11
|
|
7
|
+
mipmaps:
|
|
8
|
+
mipMapMode: 0
|
|
9
|
+
enableMipMap: 1
|
|
10
|
+
sRGBTexture: 1
|
|
11
|
+
linearTexture: 0
|
|
12
|
+
fadeOut: 0
|
|
13
|
+
borderMipMap: 0
|
|
14
|
+
mipMapsPreserveCoverage: 0
|
|
15
|
+
alphaTestReferenceValue: 0.5
|
|
16
|
+
mipMapFadeDistanceStart: 1
|
|
17
|
+
mipMapFadeDistanceEnd: 3
|
|
18
|
+
bumpmap:
|
|
19
|
+
convertToNormalMap: 0
|
|
20
|
+
externalNormalMap: 0
|
|
21
|
+
heightScale: 0.25
|
|
22
|
+
normalMapFilter: 0
|
|
23
|
+
isReadable: 0
|
|
24
|
+
streamingMipmaps: 0
|
|
25
|
+
streamingMipmapsPriority: 0
|
|
26
|
+
vTOnly: 0
|
|
27
|
+
grayScaleToAlpha: 0
|
|
28
|
+
generateCubemap: 6
|
|
29
|
+
cubemapConvolution: 0
|
|
30
|
+
seamlessCubemap: 0
|
|
31
|
+
textureFormat: 1
|
|
32
|
+
maxTextureSize: 2048
|
|
33
|
+
textureSettings:
|
|
34
|
+
serializedVersion: 2
|
|
35
|
+
filterMode: 1
|
|
36
|
+
aniso: 1
|
|
37
|
+
mipBias: 0
|
|
38
|
+
wrapU: 0
|
|
39
|
+
wrapV: 0
|
|
40
|
+
wrapW: 0
|
|
41
|
+
nPOTScale: 1
|
|
42
|
+
lightmap: 0
|
|
43
|
+
compressionQuality: 50
|
|
44
|
+
spriteMode: 0
|
|
45
|
+
spriteExtrude: 1
|
|
46
|
+
spriteMeshType: 1
|
|
47
|
+
alignment: 0
|
|
48
|
+
spritePivot: {x: 0.5, y: 0.5}
|
|
49
|
+
spritePixelsToUnits: 100
|
|
50
|
+
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
51
|
+
spriteGenerateFallbackPhysicsShape: 1
|
|
52
|
+
alphaUsage: 1
|
|
53
|
+
alphaIsTransparency: 1
|
|
54
|
+
spriteTessellationDetail: -1
|
|
55
|
+
textureType: 0
|
|
56
|
+
textureShape: 1
|
|
57
|
+
singleChannelComponent: 0
|
|
58
|
+
flipbookRows: 1
|
|
59
|
+
flipbookColumns: 1
|
|
60
|
+
maxTextureSizeSet: 0
|
|
61
|
+
compressionQualitySet: 0
|
|
62
|
+
textureFormatSet: 0
|
|
63
|
+
ignorePngGamma: 0
|
|
64
|
+
applyGammaDecoding: 0
|
|
65
|
+
platformSettings:
|
|
66
|
+
- serializedVersion: 3
|
|
67
|
+
buildTarget: DefaultTexturePlatform
|
|
68
|
+
maxTextureSize: 2048
|
|
69
|
+
resizeAlgorithm: 0
|
|
70
|
+
textureFormat: -1
|
|
71
|
+
textureCompression: 1
|
|
72
|
+
compressionQuality: 50
|
|
73
|
+
crunchedCompression: 0
|
|
74
|
+
allowsAlphaSplitting: 0
|
|
75
|
+
overridden: 0
|
|
76
|
+
androidETC2FallbackOverride: 0
|
|
77
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
78
|
+
- serializedVersion: 3
|
|
79
|
+
buildTarget: Standalone
|
|
80
|
+
maxTextureSize: 2048
|
|
81
|
+
resizeAlgorithm: 0
|
|
82
|
+
textureFormat: -1
|
|
83
|
+
textureCompression: 1
|
|
84
|
+
compressionQuality: 50
|
|
85
|
+
crunchedCompression: 0
|
|
86
|
+
allowsAlphaSplitting: 0
|
|
87
|
+
overridden: 0
|
|
88
|
+
androidETC2FallbackOverride: 0
|
|
89
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
90
|
+
- serializedVersion: 3
|
|
91
|
+
buildTarget: iPhone
|
|
92
|
+
maxTextureSize: 2048
|
|
93
|
+
resizeAlgorithm: 0
|
|
94
|
+
textureFormat: -1
|
|
95
|
+
textureCompression: 1
|
|
96
|
+
compressionQuality: 50
|
|
97
|
+
crunchedCompression: 0
|
|
98
|
+
allowsAlphaSplitting: 0
|
|
99
|
+
overridden: 0
|
|
100
|
+
androidETC2FallbackOverride: 0
|
|
101
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
102
|
+
- serializedVersion: 3
|
|
103
|
+
buildTarget: WebGL
|
|
104
|
+
maxTextureSize: 2048
|
|
105
|
+
resizeAlgorithm: 0
|
|
106
|
+
textureFormat: -1
|
|
107
|
+
textureCompression: 1
|
|
108
|
+
compressionQuality: 50
|
|
109
|
+
crunchedCompression: 0
|
|
110
|
+
allowsAlphaSplitting: 0
|
|
111
|
+
overridden: 0
|
|
112
|
+
androidETC2FallbackOverride: 0
|
|
113
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
114
|
+
- serializedVersion: 3
|
|
115
|
+
buildTarget: Android
|
|
116
|
+
maxTextureSize: 2048
|
|
117
|
+
resizeAlgorithm: 0
|
|
118
|
+
textureFormat: -1
|
|
119
|
+
textureCompression: 1
|
|
120
|
+
compressionQuality: 50
|
|
121
|
+
crunchedCompression: 0
|
|
122
|
+
allowsAlphaSplitting: 0
|
|
123
|
+
overridden: 0
|
|
124
|
+
androidETC2FallbackOverride: 0
|
|
125
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
126
|
+
spriteSheet:
|
|
127
|
+
serializedVersion: 2
|
|
128
|
+
sprites: []
|
|
129
|
+
outline: []
|
|
130
|
+
physicsShape: []
|
|
131
|
+
bones: []
|
|
132
|
+
spriteID:
|
|
133
|
+
internalID: 0
|
|
134
|
+
vertices: []
|
|
135
|
+
indices:
|
|
136
|
+
edges: []
|
|
137
|
+
weights: []
|
|
138
|
+
secondaryTextures: []
|
|
139
|
+
spritePackingTag:
|
|
140
|
+
pSDRemoveMatte: 0
|
|
141
|
+
pSDShowRemoveMatteOption: 0
|
|
142
|
+
userData:
|
|
143
|
+
assetBundleName:
|
|
144
|
+
assetBundleVariant:
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#if UNITY_EDITOR
|
|
2
2
|
using System;
|
|
3
|
-
using UnityEditor;
|
|
4
3
|
using UnityEngine;
|
|
5
4
|
|
|
6
5
|
namespace TyphoonUnitySDK
|
|
@@ -10,30 +9,6 @@ namespace TyphoonUnitySDK
|
|
|
10
9
|
/// </summary>
|
|
11
10
|
public class SimulateRecordGame : MonoSingleton<SimulateRecordGame>
|
|
12
11
|
{
|
|
13
|
-
private static GUIStyle _boldLabel = null;
|
|
14
|
-
|
|
15
|
-
public static GUIStyle BoldLabel
|
|
16
|
-
{
|
|
17
|
-
get
|
|
18
|
-
{
|
|
19
|
-
if (_boldLabel == null)
|
|
20
|
-
{
|
|
21
|
-
_boldLabel = new GUIStyle(GUI.skin.label);
|
|
22
|
-
_boldLabel.alignment = TextAnchor.MiddleCenter;
|
|
23
|
-
_boldLabel.fixedWidth = 0;
|
|
24
|
-
_boldLabel.fixedHeight = 0;
|
|
25
|
-
_boldLabel.fontSize = 30;
|
|
26
|
-
_boldLabel.fontStyle = FontStyle.Bold;
|
|
27
|
-
_boldLabel.normal.textColor = Color.white;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return _boldLabel;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
public static float HOLD_TIME => SdkTestInUnity.Instance.InteractiveHoldCloseTime;
|
|
36
|
-
|
|
37
12
|
/*是否在录制中*/
|
|
38
13
|
public bool IsRecording = false;
|
|
39
14
|
|
|
@@ -43,16 +18,6 @@ namespace TyphoonUnitySDK
|
|
|
43
18
|
/*录制时长*/
|
|
44
19
|
public float RecordTime;
|
|
45
20
|
|
|
46
|
-
/*展示*/
|
|
47
|
-
public bool IsShow = false;
|
|
48
|
-
|
|
49
|
-
public float HoldTimeYes;
|
|
50
|
-
|
|
51
|
-
public float HoldTimeNo;
|
|
52
|
-
|
|
53
|
-
private Action _onSuccess;
|
|
54
|
-
private Action _onFail;
|
|
55
|
-
|
|
56
21
|
|
|
57
22
|
protected override void Init()
|
|
58
23
|
{
|
|
@@ -110,97 +75,8 @@ namespace TyphoonUnitySDK
|
|
|
110
75
|
return;
|
|
111
76
|
}
|
|
112
77
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
IsShow = true;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
private void OnGUI()
|
|
120
|
-
{
|
|
121
|
-
if (IsShow)
|
|
122
|
-
{
|
|
123
|
-
var rect = new Rect(0, 0, Screen.width, Screen.height);
|
|
124
|
-
|
|
125
|
-
// var retTitle = rect;
|
|
126
|
-
// retTitle.width = 400;
|
|
127
|
-
// retTitle.height = 128;
|
|
128
|
-
// retTitle.center = rect.center;
|
|
129
|
-
// retTitle.y -= 400;
|
|
130
|
-
// DrawViewTxtLabel(retTitle, "悬停选择", TextAnchor.MiddleCenter, 1);
|
|
131
|
-
|
|
132
|
-
var rectBtnYes = rect;
|
|
133
|
-
rectBtnYes.width = 346;
|
|
134
|
-
rectBtnYes.height = 200;
|
|
135
|
-
rectBtnYes.center = rect.center;
|
|
136
|
-
rectBtnYes.y += rectBtnYes.height;
|
|
137
|
-
DrawViewTxtLabel(rectBtnYes, "分享成功", TextAnchor.MiddleCenter, 1);
|
|
138
|
-
|
|
139
|
-
var rectBtnNo = rectBtnYes;
|
|
140
|
-
rectBtnNo.center = rect.center;
|
|
141
|
-
rectBtnNo.y -= rectBtnNo.height;
|
|
142
|
-
DrawViewTxtLabel(rectBtnNo, "分享失败", TextAnchor.MiddleCenter, 1);
|
|
143
|
-
|
|
144
|
-
HoldHide(rectBtnYes, ref HoldTimeYes, () =>
|
|
145
|
-
{
|
|
146
|
-
_onSuccess?.Invoke();
|
|
147
|
-
Hide();
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
HoldHide(rectBtnNo, ref HoldTimeNo, () =>
|
|
151
|
-
{
|
|
152
|
-
_onFail?.Invoke();
|
|
153
|
-
Hide();
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
private void Hide()
|
|
159
|
-
{
|
|
160
|
-
IsShow = false;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
/*长按隐藏*/
|
|
165
|
-
private void HoldHide(Rect rectClose, ref float holdTime, Action hideHandler)
|
|
166
|
-
{
|
|
167
|
-
var inside = rectClose.Contains(Event.current.mousePosition);
|
|
168
|
-
if (inside && Event.current.delta == Vector2.zero)
|
|
169
|
-
{
|
|
170
|
-
holdTime += Time.unscaledDeltaTime;
|
|
171
|
-
var process = Mathf.Clamp01(holdTime / HOLD_TIME);
|
|
172
|
-
var rectProcess = rectClose;
|
|
173
|
-
rectProcess.width *= process;
|
|
174
|
-
var color = GUI.color;
|
|
175
|
-
EditorGUI.DrawRect(rectProcess, Color.green * 0.5f);
|
|
176
|
-
if (process >= 1)
|
|
177
|
-
{
|
|
178
|
-
hideHandler?.Invoke();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
else
|
|
182
|
-
{
|
|
183
|
-
holdTime = 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (inside && Event.current.type == EventType.MouseDown)
|
|
187
|
-
{
|
|
188
|
-
hideHandler?.Invoke();
|
|
189
|
-
Event.current.Use();
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
private void DrawViewTxtLabel(Rect rect, string label, TextAnchor alignment = TextAnchor.MiddleCenter,
|
|
195
|
-
float dark = 0.75f)
|
|
196
|
-
{
|
|
197
|
-
EditorGUI.DrawRect(rect, Color.black * dark);
|
|
198
|
-
var rectLab = rect;
|
|
199
|
-
rectLab.width -= 10;
|
|
200
|
-
rectLab.height -= 10;
|
|
201
|
-
rectLab.center = rect.center;
|
|
202
|
-
BoldLabel.alignment = alignment;
|
|
203
|
-
GUI.Label(rectLab, label, BoldLabel);
|
|
78
|
+
GUIMessageBox.Instance.Show("请选择分享返回结果", "成功返回", "失败返回", () => success?.Invoke(),
|
|
79
|
+
() => fail?.Invoke());
|
|
204
80
|
}
|
|
205
81
|
}
|
|
206
82
|
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.
|
|
1
|
+
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.24","description":"unity端个汇总渠道的sdk,统一接口,一键发布","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
|