Commit 9beaf30d authored by shujianhe's avatar shujianhe

1 实现进度保存,单张

2 填色区域和组进度关联 组进度变化 波浪效果
3 加载进度条
parent f3192eda
......@@ -36,7 +36,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -81, y: 878}
m_SizeDelta: {x: 36, y: 36}
m_SizeDelta: {x: 200, y: 200}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &810986338845534415
CanvasRenderer:
......@@ -93,15 +93,15 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 32.2
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_enableAutoSizing: 0
m_fontSizeMin: 10
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
......
......@@ -35,8 +35,8 @@ RectTransform:
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: 61}
m_SizeDelta: {x: 148, y: 32}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 110, y: 110}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &637148015308226340
CanvasRenderer:
......@@ -66,7 +66,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: e1c879e803b7bf341850c0ace38a515f, type: 3}
m_Sprite: {fileID: 21300000, guid: f2380fc434093c241a6cab57cffb82f8, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
......@@ -76,82 +76,6 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5882378146322591837
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 73259668606617614}
- component: {fileID: 369255888022981877}
- component: {fileID: 3058710508561533708}
m_Layer: 5
m_Name: minBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &73259668606617614
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5882378146322591837}
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: 1616143210361961396}
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: 90, y: 90}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &369255888022981877
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5882378146322591837}
m_CullTransparentMesh: 1
--- !u!114 &3058710508561533708
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5882378146322591837}
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.60754716, b: 0.60754716, 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: e1eb2cb8ea58bd54681a7950ef2cf00c, type: 3}
m_Type: 3
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 0
m_FillOrigin: 2
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6004577723284806528
GameObject:
m_ObjectHideFlags: 0
......@@ -242,9 +166,10 @@ GameObject:
m_Component:
- component: {fileID: 8453382958569157211}
- component: {fileID: 1147814174343809736}
- component: {fileID: 1787754176526650320}
- component: {fileID: 7976428067039409740}
m_Layer: 5
m_Name: lowBar
m_Name: circle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -259,7 +184,7 @@ RectTransform:
m_GameObject: {fileID: 7289411106616376695}
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_LocalScale: {x: 0.6, y: 0.6, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1616143210361961396}
......@@ -278,7 +203,7 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7289411106616376695}
m_CullTransparentMesh: 1
--- !u!114 &7976428067039409740
--- !u!114 &1787754176526650320
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
......@@ -287,94 +212,36 @@ MonoBehaviour:
m_GameObject: {fileID: 7289411106616376695}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Script: {fileID: 11500000, guid: d6a140759d40b744e891af608357385b, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.41037738, g: 1, b: 0.41851088, 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: c4a8d1f39b589d747ba0b9ecc99f8f5d, 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 &7706314437183634079
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7341643178725361735}
- component: {fileID: 7553108749846778778}
- component: {fileID: 2547549287289153947}
m_Layer: 5
m_Name: finish
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7341643178725361735
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7706314437183634079}
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: 1616143210361961396}
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: 51, y: 38}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7553108749846778778
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7706314437183634079}
m_CullTransparentMesh: 1
--- !u!114 &2547549287289153947
color1: {r: 1, g: 1, b: 0, a: 1}
color2: {r: 1, g: 0, b: 1, a: 1}
height: 0.1
langValue: 0.08
radius: 80
speed: 5
--- !u!114 &7976428067039409740
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7706314437183634079}
m_GameObject: {fileID: 7289411106616376695}
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.627451, b: 0.627451, a: 1}
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: 9f03d019d8287bb40a8a15877586fa3c, type: 3}
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
......@@ -416,15 +283,13 @@ RectTransform:
m_Children:
- {fileID: 8307886021508962735}
- {fileID: 8453382958569157211}
- {fileID: 73259668606617614}
- {fileID: 6241380524619156769}
- {fileID: 7341643178725361735}
m_Father: {fileID: 0}
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: -228.9, y: -378}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &3851703331259501924
......@@ -499,3 +364,5 @@ MonoBehaviour:
nowProgress: 0.35
idName: 12
useColor: {r: 0.9612525, g: 0.9811321, b: 0, a: 1}
index: 0
selectLang: 0.25
fileFormatVersion: 2
guid: ec9da1a89b6f08d449647e8be52ef1f9
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: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 1
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: 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: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 54ac8b67ea1f6f14892bd14ea1caab62
guid: f2380fc434093c241a6cab57cffb82f8
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
......@@ -48,7 +48,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 1
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
......
fileFormatVersion: 2
guid: e1c879e803b7bf341850c0ace38a515f
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: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 1
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: 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: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
[System.Serializable]
public class AreaInfoUseData
......@@ -10,6 +11,7 @@ public class AreaInfoUseData
}
public class GameScenUserInfo
{
static public string RunGameDatasRootName = "gameData";
public string img = "";//线图
public string json = "";//数据
public string finishImg = "";//完成图
......@@ -17,6 +19,60 @@ public class GameScenUserInfo
//以上是url
public int status = 0;//0 未开始 1 这个id进过游戏 2 至少有一个区域点亮 3完成
public double progress = 0;//0 -- 1 具体自己算百分比
public string localprogress = "";//缩略图路径 status < 2 文件是未创建
public List<AreaInfoUseData> areaInfoUseData = new List<AreaInfoUseData>();
private string getUrlByLocalPath(string url)
{
if (url.StartsWith("http") == false) return "";
int idx = url.LastIndexOf("/");
int idx1 = url.LastIndexOf(".");
if (idx < 0 || idx1 < idx)
{
return "";
}
string localName = url.Substring(idx, idx1 - idx).Trim();
if (localName.Length == 0) return "";
if (localName.StartsWith("/")) localName = localName.Substring(1);
string ret = utilsTools.getWritableByPath(RunGameDatasRootName+"/" + localName);
ret = ret + url.Substring(idx1);
return ret;
}
public string getLineImgLocalPath()
{
return getUrlByLocalPath(img);
}
public string getColorImgLocalPath()
{
return getUrlByLocalPath(finishImg);
}
public string getJsonLocalPath()
{
return getUrlByLocalPath(json);
}
public string getLocalThumbnailPath()
{
if (id.Equals("")) return "";
string path = getUrlByLocalPath(json);
if (path.Equals("")) return "";
int idx = path.LastIndexOf("/");
string ret = path.Substring(0, idx+1) + id + "/run_suolue_line.png";
return ret;
}
public bool createWorkDirectory()
{
string path = getLocalThumbnailPath();
if (path.Equals("")) return false;
int idx = path.LastIndexOf("/");
string dirpath = path.Substring(0, idx);
utilsTools.CreateDirectory(dirpath);
return true;
}
//format 后出现目录,自己在外面控制这里不做判定
public string getPathByFormath(string format, params System.Object[] args)
{
string name = string.Format(format, args);
string ret = utilsTools.getWritableByPath(RunGameDatasRootName + "/"+ id+"/" + name);
return ret;
}
}
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
public class gameIdJsonData
......@@ -9,4 +10,24 @@ public class gameIdJsonData
public short height = 0;
public List<gameAreaItem> roomDatas = new List<gameAreaItem>();
public List<gameAreaGroupItem> roomGroupsData = new List<gameAreaGroupItem>();
public bool findGid(short gid)
{
for (int i = 0; i < roomGroupsData.Count; i++)
{
if (roomGroupsData[i].id.Equals(gid))return true;
}
return false;
}
public bool findAid(short id)
{
return false;
}
public gameAreaGroupItem getRoomGroup(short id)
{
for (int i = 0; i < roomGroupsData.Count; i++)
{
if (roomGroupsData[i].id.Equals(id)) return roomGroupsData[i];
}
return null;
}
}
using JetBrains.Annotations;
using System.Collections;
using System.Collections.Generic;
using UnityEditor.UI;
using UnityEngine;
using UnityEngine.UI;
public class gameInLoading : MonoBehaviour,IEventHandler
{
private float nowValue = 0;
private float tarvalue = 0;
private float stepvalue = 0;
private float maxvalue = 100f;
private Slider slider = null;
public void onEventHandler(string eventName, List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
if (eventName.Equals("inGameLoadingValue"))
{
float addValue = (float)objects[0];
bool isEnd = (bool)objects[1];
if(isEnd == false)
{
tarvalue += addValue;
if(tarvalue >= (maxvalue - 1f))
{
tarvalue = maxvalue - 2f;//不要超出去
}
}
else
{
tarvalue = maxvalue;
}
float stepvalue1 = (tarvalue - nowValue) / 50f;
if(stepvalue1 < 0.015f)
{
stepvalue1 = 0.015f;
}
stepvalue = stepvalue1;
}
}
// Start is called before the first frame update
void Start()
{
slider = this.GetComponent<Slider>();
slider.value = 0;
slider.maxValue = maxvalue;
slider.minValue = 0;
utilsTools.onEvent(this, "inGameLoadingValue");
//utilsTools.addTimer_Sec(gameObject, "testSce", (string name) =>
//{
// utilsTools.sendEventObjectParams("inGameLoadingValue",8f,tarvalue > 60f);
// return tarvalue < 99f;
//}, 3, 10);
}
// Update is called once per frame
void Update()
{
if (utilsTools.isEqualByValue(stepvalue, 0.0f, 0.00000003f))
{
return;
}
nowValue = nowValue + stepvalue;
if(nowValue >= maxvalue)
{
nowValue = maxvalue;
slider.value = nowValue;
stepvalue = 0.0f;
gameObject.SetActive(false);
//需要通知出去满了
utilsTools.sendEvent("inGameLoadingBarEnd");
return;
}
else
{
if(nowValue > tarvalue)
{
nowValue = tarvalue;
stepvalue = 0.0f;
}
slider.value = nowValue;
}
}
}
fileFormatVersion: 2
guid: 986cf038c0340554193659d46375c99d
folderAsset: yes
DefaultImporter:
guid: 582a8965e0faeec4a8df7d0271769c6d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -4,6 +4,9 @@ using UnityEngine;
public class gameSceneAreaGroupHandler : gridView
{
private float itemWidth = 100f;
private float itemHeight = 100f;
private float itemInterval = 20f;
// Start is called before the first frame update
void Start()
{
......@@ -11,14 +14,17 @@ public class gameSceneAreaGroupHandler : gridView
utilsTools.DisplaySize = new Vector2(rectTransform.rect.width, rectTransform.rect.height);
float scale = rectTransform.rect.height / 1920;
var scale1 = transform.localScale;
scale1.y *= scale;
transform.localScale = scale1;
itemWidth = itemWidth * scale1.x;
itemHeight = itemHeight * scale1.y;
itemInterval = itemWidth * scale1.x;
//transform.localScale = scale1;
}
// Update is called once per frame
void Update()
void Update(){
}
public void setDataNoGrid(int cout, gradViewBack gradView)
{
setDataNoGrid(cout, itemWidth, itemHeight, itemInterval, gradView, false,null,20);
}
}
......@@ -15,19 +15,25 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
private int nowidx = 4;
public float progress = 0;
public bool showAreaId = true;
private TextMeshProUGUI debugViewObj = null;
private List<TempGroupInfos> groupInfos = null;
private Vector2 pos1 = new Vector2(-10000, -10000);
private int rvalue = -1;
Dictionary<string, EventChildItemBack> childEventHandlers = new Dictionary<string, EventChildItemBack>();
void onEvent(string name, EventChildItemBack func)
{
utilsTools.onEvent(this, name);
childEventHandlers.Add(name, func);
}
void Start()
{
//GetComponent<TextMeshProUGUI>()
utilsTools.onEvent(this, "switchGameAreaGroupId");
utilsTools.onEvent(this, "gameViewOnInitEnd");
utilsTools.onEvent(this, "gameClickPos");
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
onEvent("switchGameAreaGroupId",this.onEvent_switchGameAreaGroupId_Handler);
onEvent("gameViewOnInitEnd",this.onEvent_gameViewOnInitEnd_Handler);
onEvent("gameClickPos",this.onEvent_gameClickPos_Handler);
onEvent("inGameLoadingBarEnd",this.onEvent_inGameLoadingBarEnd_Handler);
onEvent("showAreaEventOk", onSelectAreaEvent);
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
gridViewList.gameObject.SetActive(false);
gameShowView.GetComponent<mainGameView>().loadTest();
}
// Update is called once per frame
......@@ -45,7 +51,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
Vector3 vector3;
Quaternion quaternion;
gobject.transform.GetLocalPositionAndRotation(out vector3, out quaternion);
vector3.y = -95f;
vector3.y = -130f;
if (isSelect)
{
vector3.y = vector3.y + 14;
......@@ -54,79 +60,129 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
item.IdName = (group.gid).ToString();
item.index = idx;
item.UseColor = group.rgb;
item.NowProgress = group.jindu;
item.NowProgress = group.Jindu;
}
}
public void onEventHandler(string eventName, List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
if (eventName.Equals("switchGameAreaGroupId"))
if (childEventHandlers.ContainsKey(eventName))
{
Vector3 vector3;
Quaternion quaternion;
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
colorItem item = null;
if (nowidx >= 0)
{
item = gridViewList.getObjectById(nowidx).GetComponent<colorItem>();
item.IsSelect = false;
item.transform.GetLocalPositionAndRotation(out vector3, out quaternion);
vector3.y = vector3.y - 14;
item.transform.SetLocalPositionAndRotation(vector3, quaternion);
}
var maingameView = gameShowView.GetComponent<mainGameView>();
int idx = (int)objects[0];
nowidx = idx;
var nowSelectGroupId = groupInfos[idx].gid;
item = gridViewList.getObjectById(idx).GetComponent<colorItem>();
item.IsSelect = true;
childEventHandlers[eventName](uobjects, objects);
}
}
private void onEvent_switchGameAreaGroupId_Handler(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
Vector3 vector3;
Quaternion quaternion;
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
colorItem item = null;
if (nowidx >= 0)
{
item = gridViewList.getObjectById(nowidx).GetComponent<colorItem>();
item.IsSelect = false;
item.transform.GetLocalPositionAndRotation(out vector3, out quaternion);
vector3.y = vector3.y + 14;
vector3.y = vector3.y - 14;
item.transform.SetLocalPositionAndRotation(vector3, quaternion);
Debug.Log("切换下标开始" + nowSelectGroupId.ToString());
maingameView.switchShowAreaGroup((short)nowSelectGroupId, (int id, bool isOk) => {
}
var maingameView = gameShowView.GetComponent<mainGameView>();
int idx = (int)objects[0];
nowidx = idx;
var nowSelectGroupId = groupInfos[idx].gid;
item = gridViewList.getObjectById(idx).GetComponent<colorItem>();
item.IsSelect = true;
item.transform.GetLocalPositionAndRotation(out vector3, out quaternion);
vector3.y = vector3.y + 14;
item.transform.SetLocalPositionAndRotation(vector3, quaternion);
Debug.Log("切换下标开始" + nowSelectGroupId.ToString());
maingameView.switchShowAreaGroup((short)nowSelectGroupId, (int id, bool isOk) => {
Debug.Log("切换下标完成" + id.ToString());
});
}
private void onEvent_gameViewOnInitEnd_Handler(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
gridViewList.gameObject.SetActive(true);
var maingameView = gameShowView.GetComponent<mainGameView>();
var groupInfos1 = maingameView.getGroups();
groupInfos = new List<TempGroupInfos>();
for (int i = 0; i < groupInfos1.Count; i++)
{
if (groupInfos1[i].Jindu == 1)
{
continue;
}
groupInfos.Add(groupInfos1[i]);
}
gradViewBack gradView = (GameObject gobject, int idx, ListViewBackTypeEnum lvbType) => {
this.onUpdateGroupGridHandler(gobject, idx, lvbType, groupInfos[idx]);
};
gridViewList.setDataNoGrid(groupInfos.Count, gradView);
if (nowidx >= 0)
{
maingameView.switchShowAreaGroup((short)(groupInfos[nowidx].gid), (int id, bool isOk) => {
Debug.Log("切换下标完成" + id.ToString());
});
}else if (eventName.Equals("gameViewOnInitEnd"))
}
}
private void onEvent_gameClickPos_Handler(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
short x = (short)objects[0];
short y = (short)objects[1];
var maingameView = gameShowView.GetComponent<mainGameView>();
maingameView.showAreaByPos(x, y, (int id, bool isOk) => {
Debug.Log("点击区域" + id.ToSafeString() + " 显示" + isOk.ToSafeString());
return;
});
}
private void onEvent_inGameLoadingBarEnd_Handler(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
transform.Find("ingameLoad/loadImg").gameObject.SetActive(false);
}
void onSelectAreaEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
gameAreaItem gameArea = (gameAreaItem)objects[0];
short x = (short)objects[1];
short y = (short)objects[2];
if (groupInfos != null)
{
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
gridViewList.gameObject.SetActive(true);
var maingameView = gameShowView.GetComponent<mainGameView>();
groupInfos = maingameView.getGroups();
int cout = 0;
for (int i = 0; i < groupInfos.Count; i++)
colorItem item = null;
groupInfos[nowidx].show++;
if (groupInfos[nowidx].show.Equals(groupInfos[nowidx].size))//直接移除
{
if(groupInfos[i].jindu == 1) {
break;
if(nowidx == groupInfos.Count - 1)
{
groupInfos.RemoveAt(nowidx);
nowidx--;
}else
groupInfos.RemoveAt(nowidx);
//切换组
gradViewBack gradView = (GameObject gobject, int idx, ListViewBackTypeEnum lvbType) => {
this.onUpdateGroupGridHandler(gobject, idx, lvbType, groupInfos[idx]);
};
gridViewList.setDataNoGrid(groupInfos.Count, gradView);
if (nowidx >= 0)
{
var maingameView = gameShowView.GetComponent<mainGameView>();
maingameView.switchShowAreaGroup((short)(groupInfos[nowidx].gid), (int id, bool isOk) => {
Debug.Log("切换下标完成" + id.ToString());
});
}
cout++;
}
gridViewList.setDataNoGrid(cout, 150, 150, 20, (GameObject gobject, int idx, ListViewBackTypeEnum lvbType) =>
{
this.onUpdateGroupGridHandler(gobject, idx, lvbType, groupInfos[idx]);
}, false);
if(nowidx > 0)
else
{
//Debug.Log("切换下标开始" + nowSelectGroupId.ToString());
maingameView.switchShowAreaGroup((short)(groupInfos[nowidx].gid), (int id,bool isOk) => {
Debug.Log("切换下标完成" + id.ToString());
});
item = gridViewList.getObjectById(nowidx).GetComponent<colorItem>();
item.NowProgress = groupInfos[nowidx].Jindu;
}
}else if (eventName.Equals("gameClickPos"))
{
short x = (short)objects[0];
short y = (short)objects[1];
var maingameView = gameShowView.GetComponent<mainGameView>();
maingameView.showAreaByPos(x,y, (int id,bool isOk) => {
Debug.Log("点击区域" + id.ToSafeString() + " 显示" + isOk.ToSafeString());
return;
});
//groupInfos = maingameView.getGroups();
}
}
public void onTestTemp1()
{
Debug.Log("---->>>");
}
}
......@@ -7,12 +7,34 @@ using UnityEngine.Assertions;
public class gameUserInfos : MonoBehaviour, IEventHandler
{
private string gameSaveKey = "";
// Start is called before the first frame update
private GameScenUserInfo gameScenUserInfo = null;
Dictionary<string, EventChildItemBack> childEventHandlers = new Dictionary<string, EventChildItemBack>();
void onEvent(string name, EventChildItemBack func)
{
utilsTools.onEvent(this, name);
childEventHandlers.Add(name, func);
}
void Start()
{
onEvent("showAreaEventOk", onSelectAreaEvent);
loadTest();
}
public void loadTest()
{
string id = "test";
GameScenUserInfo gameScenUser = utilsTools.getGameScenUserInfo(id);
if (gameScenUser == null)
{
utilsTools.setGameScenUserInfo(id,"http://192.168.124.160:8795/srcImgs/colorFan/tuline.png","http://192.168.124.160:8795/srcImgs/colorFan/tucolor.png","http://192.168.124.160:8795/srcImgs/colorFan/tu.json");
gameScenUser = utilsTools.getGameScenUserInfo(id);
}
if (gameScenUser == null)
{
Debug.Log("无法加载测试图片信息");
return;
}
startId(id);
}
// Update is called once per frame
void Update()
{
......@@ -24,16 +46,40 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
{
return;
}
List<short> shorts = new List<short>();
for (int i = 0; i < gameScenUser.areaInfoUseData.Count; i++)
//List<short> shorts = new List<short>();
//for (int i = 0; i < gameScenUser.areaInfoUseData.Count; i++)
//{
// shorts.Add(gameScenUser.areaInfoUseData[i].id);
//}
//GetComponent<mainGameView>().loadGameImgId(gameScenUser.img, gameScenUser.finishImg, gameScenUser.json,"",shorts);
if(GetComponent<mainGameView>().loadGameImgId(gameScenUser) == false)
{
return;
}
else
{
shorts.Add(gameScenUser.areaInfoUseData[i].id);
gameScenUserInfo = gameScenUser;
}
GetComponent<mainGameView>().loadGameImgId(gameScenUser.img, gameScenUser.finishImg, gameScenUser.json,"",shorts);
}
void IEventHandler.onEventHandler(string eventName, List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
if (childEventHandlers.ContainsKey(eventName)) childEventHandlers[eventName](uobjects, objects);
}
//永久保存
void onSelectAreaEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
if(gameScenUserInfo != null)
{
gameAreaItem gameArea = (gameAreaItem)objects[0];
short x = (short)objects[1];
short y = (short)objects[2];
AreaInfoUseData areaInfoUseData = new AreaInfoUseData();
areaInfoUseData.clickX = x;
areaInfoUseData.clickY = y;
areaInfoUseData.id = gameArea.id;
gameScenUserInfo.areaInfoUseData.Add(areaInfoUseData);
utilsTools.saveGameScenUserInfo(gameScenUserInfo);
}
}
}
......@@ -19,22 +19,16 @@ public class salaScene_bottom : MonoBehaviour
{
if (value >=0 && value < gameObject.transform.childCount)
{
List<System.Object> objects = new List<System.Object>();
objects.Add("");
objects.Add(false);
if (oldIdx >= 0)
{
objects[0] = transform.GetChild(OldIdx).name;
Button button = transform.GetChild(oldIdx).gameObject.GetComponent<Button>();
button.interactable = true;
utilsTools.sendEventObjects("switchPage", objects);
utilsTools.sendEventObjectParams("switchPage", transform.GetChild(OldIdx).name,false);
}
oldIdx = value;
objects[0] = transform.GetChild(OldIdx).name;
objects[1] = true;
Button button1 = transform.GetChild(oldIdx).gameObject.GetComponent<Button>();
button1.interactable = false;
utilsTools.sendEventObjects("switchPage", objects);
utilsTools.sendEventObjectParams("switchPage", transform.GetChild(OldIdx).name,true);
}
}
......@@ -54,8 +48,7 @@ public class salaScene_bottom : MonoBehaviour
var btn = new UnityEngine.UI.Button.ButtonClickedEvent();
utilsTools.setUserData(gobjectItem.gameObject, "zhang", i);
utilsTools.sendEventObjects("switchPage", objects);
utilsTools.sendEventObjectParams("switchPage", gobjectItem.gameObject, "zhang", i);
btn.AddListener(() => {
Int32 i2 = -1;
System.Object i3 = i2;
......
......@@ -21,9 +21,7 @@ public class salaScene_labels : gridView, IEventHandler
lItem = getObjectById(idx).GetComponent<labelItem>();
lItem.select = true;
nowselect = idx;
List<System.Object> list = new List<System.Object>();
list.Add(name);
utilsTools.sendEventObjects("setImageViewLable", list);
utilsTools.sendEventObjectParams("setImageViewLable", name);
}
}
......@@ -39,9 +37,7 @@ public class salaScene_labels : gridView, IEventHandler
label.select = nowselect == idx;
if (nowselect == idx)
{
List<System.Object> list = new List<System.Object>();
list.Add(alldata[idx]);
utilsTools.sendEventObjects("setImageViewLable", list);
utilsTools.sendEventObjectParams("setImageViewLable", alldata[idx]);
}
}
......
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
using UnityEngine.UI;
using Unity.VisualScripting;
public class gameGroupEffect : MonoBehaviour
{
// Start is called before the first frame update
public Color color1 = new Color(1, 1, 0,1);//颜色1
public Color color2 = new Color(1, 0, 1,1);//颜色2
[SerializeField]
private float height = 0.25f;//当前高度
[SerializeField]
private float langValue = 0.2f;//波峰-波谷的插值
public float Height
{
get { return height; }
set
{
if (value >= 1)
{
height = 1 + langValue * 2;
return;
}
if (value <= 0)
{
height = 0 - langValue * 2;
return;
}
height = value;
}
}
public float LangValue
{
get { return langValue; }
set
{
if (value < 0 || value > 1) return;
langValue = value;
Height = height;
}
}
public short radius = 100;//显示的圆形大小
private Texture2D texture2D = null;
private float nowOffsetX = 0;
private string prveUpdateKey = "";
public float speed = 0.2f;//更新频率
void initMembers()
{
if(texture2D == null)
{
Image image = GetComponent<Image>();
RectTransform rectTransform = GetComponent<RectTransform>();
rectTransform.sizeDelta = new Vector2(radius * 2, radius * 2);
texture2D = new Texture2D(radius * 2, radius * 2);
updateTexture(ref texture2D);
Sprite sprite = Sprite.Create(texture2D, new Rect(0, 0, radius * 2, radius * 2), new Vector2(0.5f, 0.5f));
var oldSprite = image.sprite;
image.sprite = sprite;
texture2D.Apply();
GameObject.Destroy(oldSprite);
oldSprite = null;
}
}
void Start()
{
try
{
initMembers();
}
catch (Exception e)
{
Debug.Log(e);
}
}
bool updateTexture(ref Texture2D texture2D)
{
Color colorEmpty = new Color(0, 0, 0, 0);
float qujian = langValue * radius * 2;
float height1 = height * radius * 2;
string prvateKey = string.Format("{0}_{1}_{2}_{3}_{4}_{5}", color1.ToString(), color2.ToString(), height, langValue, radius, nowOffsetX);
if (prvateKey.Equals(prveUpdateKey) && (langValue == 0.0f || speed == 0.0f))
{
return false;
}
prveUpdateKey = prvateKey;
nowOffsetX = (nowOffsetX + speed) % 1080;
//边界值问题
for (int x = 0 - radius; x < radius; x++)
{
double huduValue = ((x + this.nowOffsetX) % 360 * Math.PI) / 180.0;
double y1 = Math.Sin(huduValue);//-1 ---- +1
double fenge = height1 - qujian/2 + y1 * qujian/2;
for (int y = 0 - radius; y < radius; y++)
{
if ((x * x + y * y) < (radius * radius)){
if(langValue == 0)
{
if((y + radius) > height1)
{
texture2D.SetPixel(x + radius, y + radius, color1);
}
else
{
texture2D.SetPixel(x + radius, y + radius, color2);
}
}
else
{
if((y+radius) > fenge)
{
texture2D.SetPixel(x + radius, y + radius, color1);
}
else
{
texture2D.SetPixel(x + radius, y + radius, color2);
}
}
}
else
{
texture2D.SetPixel(x+radius, y+radius, colorEmpty);
}
}
}
return true;
}
// Update is called once per frame
void Update()
{
initMembers();
if (updateTexture(ref texture2D) == true)
{
texture2D.Apply();
}
}
}
fileFormatVersion: 2
guid: d6a140759d40b744e891af608357385b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -158,7 +158,7 @@ public class gridView : MonoBehaviour
}
}
//ֻ֧һԤ
virtual public void setDataNoGrid(int size,float widthItem,float heightItem,float interval,gradViewBack back, bool useVec = true, GetGradViewInfo getGradViewInfo = null)
virtual public void setDataNoGrid(int size,float widthItem,float heightItem,float interval,gradViewBack back, bool useVec = true, GetGradViewInfo getGradViewInfo = null,float offset1 = 0.0f)
{
if (perfabPaths.Count == 0)
......@@ -215,7 +215,7 @@ public class gridView : MonoBehaviour
{
float h = GetComponent<RectTransform>().sizeDelta.y;
startY = 0 - h / 2 + heightItem / 2 - (heightItem / 2 + interval / 2);
vector3.x = 0 - rectTransform.sizeDelta.x / 2;
vector3.x = 0 - rectTransform.sizeDelta.x / 2 - offset1;
float spacingLen = 0;
spacingLen = interval * (size - 1);
float height = spacingLen + coutPixel;
......@@ -228,7 +228,7 @@ public class gridView : MonoBehaviour
else
{
float w = GetComponent<RectTransform>().sizeDelta.x;
vector3.y = 0 - rectTransform.sizeDelta.y / 2;
vector3.y = 0 - rectTransform.sizeDelta.y / 2 - offset1;
startX = 0 - w / 2 + widthItem / 2 - (widthItem / 2 + interval / 2);
float spacingLen = 0;
spacingLen = interval * (size - 1);
......
......@@ -291,8 +291,7 @@ public class mainGameScaleMove : MonoBehaviour
Vector2 pos1 = vector * scaleVector;
short x = Convert.ToInt16(pos1.x + width / 2);
short y = Convert.ToInt16(pos1.y + height / 2);
List<System.Object> senddata = new List<System.Object>() {x,y};
utilsTools.sendEventObjects("gameClickPos", senddata);
utilsTools.sendEventObjectParams("gameClickPos", x,y);
}
else
{
......
This diff is collapsed.
......@@ -26,6 +26,7 @@ public delegate bool DigitMatrixSetBack(short x, short y,short c);
public delegate bool DigitMatrixIsEqual<T>(T t1, T t2);
public delegate bool DigitMatrixSetBackT<T>(short x, short y, T c);
public delegate void TaskItemBack(System.Object[] list);
public delegate void EventChildItemBack(List<UnityEngine.Object> uobjects, List<System.Object> objects);
public delegate void OnAreaHandler(int id, bool isOk);//显示区域或者显示组完成回调
public delegate void LoadImageBack(Sprite sprite,string id,Image image);
//}
......@@ -15,14 +15,25 @@ public class colorItem : MonoBehaviour
[SerializeField]
private Color useColor = new Color();
public int index = 0;
public float selectLang = 0.05f;
private gameGroupEffect effectImg = null;
void initMember()
{
if(effectImg == null)
{
effectImg = transform.Find("circle").GetComponent<gameGroupEffect>();
}
}
public bool IsSelect
{
set {
//if (nowProgress > 0.999999) return;
//transform.Find("finish").gameObject.SetActive(!value);
transform.Find("minBar").gameObject.SetActive(value);
transform.Find("nowSelectFlg").gameObject.SetActive(value);
initMember();
isSelect = value;
effectImg.LangValue = isSelect ? selectLang : 0;
//transform.Find("finish").gameObject.SetActive(!value);
//transform.Find("minBar").gameObject.SetActive(value);
transform.Find("nowSelectFlg").gameObject.SetActive(isSelect);
}
get
{
......@@ -31,7 +42,8 @@ public class colorItem : MonoBehaviour
}
public float NowProgress
{
set {
set {
initMember();
if (value <= 0)
value = 0f;
else if (value >= 0.99999998)
......@@ -42,21 +54,14 @@ public class colorItem : MonoBehaviour
}
nowProgress = value;
bool isend = this.isFinish();
var minBarTrans = transform.Find("minBar");
minBarTrans.GetComponent<Image>().fillAmount = isend ? 1.0f : 1.0f- nowProgress;
effectImg.Height = nowProgress;
transform.Find("idname").gameObject.SetActive(!isend);
transform.Find("lowBar").gameObject.SetActive(!isend);
var finish = transform.Find("finish");
finish.gameObject.SetActive(isend);
if (isend)
{
minBarTrans.gameObject.SetActive(true);
minBarTrans.GetComponent<Image>().color = useColor;
finish.GetComponent<Image>().color = useColor;
effectImg.gameObject.SetActive(false);
}
else
{
minBarTrans.gameObject.SetActive(isSelect);
}
}
get
......@@ -77,9 +82,9 @@ public class colorItem : MonoBehaviour
{
set
{
initMember();
useColor = value;
transform.Find("lowBar").GetComponent<Image>().color = useColor;
var textColor = Color.white;
if((useColor.r > 0.75 && useColor.g > 0.75) || (useColor.g > 0.75 && useColor.b > 0.75) || (useColor.r > 0.75 && useColor.b > 0.75))
{
......@@ -90,15 +95,20 @@ public class colorItem : MonoBehaviour
float s;
float v;
Color.RGBToHSV(useColor, out h, out s, out v);
if (v < 0.2)
v = 0.8f;
else if (v > 0.8)
v = 0.2f;
if(v > 0.6)
{
v = v - 0.5f;
}else if(v < 0.45f)
{
v = v + 0.5f;
}
else
v = v / 5 * 3;
{
v = v - v / 3;
}
Color color1 = Color.HSVToRGB(h, s, v);
transform.Find("minBar").GetComponent<Image>().color = color1;
transform.Find("finish").GetComponent<Image>().color = color1;
effectImg.color2 = useColor;
effectImg.color1 = color1;
}
get
{
......@@ -108,6 +118,7 @@ public class colorItem : MonoBehaviour
// Start is called before the first frame update
void Start()
{
initMember();
//IsSelect = isSelect;
//IdName = idName;
//UseColor = useColor;
......@@ -127,8 +138,7 @@ public class colorItem : MonoBehaviour
{
if (isSelect == false && isFinish() == false)
{
List<System.Object> list = new List<System.Object>{ index };
utilsTools.sendEventObjects("switchGameAreaGroupId", list);
utilsTools.sendEventObjectParams("switchGameAreaGroupId", index);
}
}
}
......@@ -56,9 +56,7 @@ public class labelItem : MonoBehaviour
}
public void OnBtnClick()
{
List<System.Object> lists = new List<System.Object>();
lists.Add(this.__title);
utilsTools.sendEventObjects("switchImageLabel", lists);
utilsTools.sendEventObjectParams("switchImageLabel", this.__title);
}
}
......@@ -26,9 +26,9 @@ public class TaskManages
utilsTools.getUserData<Stack<Tuple<TaskItemBack, System.Object[]>>>(monoBehaviour.gameObject, "PriorityStack", out taskInfos, null);
utilsTools.setUserData(monoBehaviour.gameObject, "PriorityStack", taskInfos);
}
public void insertTask(MonoBehaviour monoBehaviour, TaskItemBack taskItemBack, System.Object param1 = null,System.Object param2 = null)
public void insertTask(MonoBehaviour monoBehaviour, TaskItemBack taskItemBack, System.Object param1 = null,System.Object param2 = null,System.Object param3 = null)
{
System.Object[] allparams = { param1,param2 };
System.Object[] allparams = { param1,param2,param3 };
insertTask(monoBehaviour, taskItemBack, allparams);
}
public void addTask(MonoBehaviour monoBehaviour, TaskItemBack taskItemBack, System.Object param = null)
......
......@@ -100,11 +100,11 @@ public class utilsDB
}
public static string getDBJsonDataByKey(string key, string defvalue)
{
return getDBValueDataByKey<string>(key, "json", defvalue);
return getDBValueDataByKey<string>(key, "string", defvalue);
}
public static bool setDBJsonDataByKey(string key, string value)
{
return setDBValueDataByKey<string>(key, "json", value);
return setDBValueDataByKey<string>(key, "string", value);
}
public static List<ScenePageCellGroupItemData> getScenePageCellGroupDataByDB()
{
......
......@@ -15,6 +15,7 @@ public class utilsTools
{
private static int isPhone = 0;
private static Vector2 displaySize = new Vector2(0,0);
private static System.Random random = new System.Random();
public static bool IsPhone
{
get {
......@@ -140,6 +141,25 @@ public class utilsTools
public static bool sendEventUObjects(string name,List<UnityEngine.Object> objects,List<System.Object> list = null){
return IRunEventManages.send(name, objects, list);
}
public static bool sendEventObjectParams(string name, System.Object param1 = null,System.Object param2 = null, System.Object param3 = null, List<System.Object> listex = null)
{
List<System.Object> list = null;
if (param1 != null)
{
list = new List<System.Object>();
list.Add(param1);
if (param2 != null) list.Add(param2);
if (param3 != null) list.Add(param3);
if(listex != null)
{
for (int i = 0; i < listex.Count; i++)
{
list.Add(listex[i]);
}
}
}
return sendEventObjects(name, list);
}
public static bool sendEventObjects(string name,List<System.Object> list){
return IRunEventManages.send(name, null, list);
}
......@@ -382,6 +402,7 @@ public class utilsTools
//loadImageThumbnailById("6573",(Sprite sprite,string id,Image image)=>{if(image == null) image = gameObject.GetComponent<Image>();image.sprite = sprite;...},image1)
public static void loadImageThumbnailById(string id, LoadImageBack loadImageBack, Image image = null)
{
}
//初始化播放游戏过程
//OnAreaHandler 回调的时候才能调用replayGameProcessById
......@@ -391,7 +412,6 @@ public class utilsTools
//开始播放游戏过程
public static void replayGameProcessById(string id,GameObject gameObject,List<Tuple<short,float,float>> playOrders)
{
}
public static bool setGameScenUserInfo(string id,string lineUrl,string colorUrl,string jsonUrl)
{
......@@ -425,10 +445,6 @@ public class utilsTools
{
string gameSaveKey = "gameUserData_" + gameScenUserInfo.id;
string oldData = utilsDB.getDBStringDataByKey(gameSaveKey, "");
if (oldData.Equals("") == false)
{
return false;
}
var data = JsonUtility.FromJson<GameScenUserInfo>(oldData);
if (data.id.Equals(gameScenUserInfo.id) == false) return false;
utilsDB.setDBJsonDataByKey(gameSaveKey, JsonUtility.ToJson(gameScenUserInfo));
......@@ -478,5 +494,9 @@ public class utilsTools
Directory.CreateDirectory(path1);
}
}
public static float randValueByFloat(float min,float max)
{
return (float)random.NextDouble() * (max - min) + min;
}
}
Base path: 'C:/Program Files/Unity/Hub/Editor/2022.3.1f1c1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2022.3.1f1c1/Editor/Data/PlaybackEngines'
Cmd: initializeCompiler
Cmd: shutdown
Quitting shader compiler process
......@@ -14,12 +14,12 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: 7.2000003
y: 104.8
x: -20
y: 115.200005
width: 2033.6
height: 1000
m_ShowMode: 4
m_Title: Game
m_Title: Inspector
m_RootView: {fileID: 9}
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
......@@ -41,7 +41,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 619.2
width: 317.6001
width: 469.59998
height: 330.8
m_MinSize: {x: 232, y: 271}
m_MaxSize: {x: 10002, y: 10021}
......@@ -67,14 +67,14 @@ MonoBehaviour:
- {fileID: 2}
m_Position:
serializedVersion: 2
x: 1463.2
x: 1304.8
y: 0
width: 317.6001
width: 469.59998
height: 950
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 8096, y: 16192}
vertical: 1
controlID: 63
controlID: 541
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
......@@ -85,23 +85,23 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: ConsoleWindow
m_Name: SceneHierarchyWindow
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 317.6001
width: 469.59998
height: 619.2
m_MinSize: {x: 102, y: 121}
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 17}
m_ActualView: {fileID: 15}
m_Panes:
- {fileID: 15}
- {fileID: 17}
m_Selected: 1
m_LastSelected: 0
m_Selected: 0
m_LastSelected: 1
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 52
......@@ -117,9 +117,9 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 569.6
x: 566.4
y: 0
width: 893.6
width: 738.4
height: 950
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
......@@ -148,12 +148,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1780.8
width: 1774.4
height: 950
m_MinSize: {x: 300, y: 100}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 62
controlID: 51
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
......@@ -178,7 +178,7 @@ MonoBehaviour:
m_MinSize: {x: 400, y: 100}
m_MaxSize: {x: 32384, y: 16192}
vertical: 0
controlID: 61
controlID: 123
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
......@@ -194,9 +194,9 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 1780.8
x: 1774.4
y: 0
width: 252.79993
width: 259.19995
height: 950
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
......@@ -293,7 +293,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 569.6
width: 566.4
height: 950
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
......@@ -322,9 +322,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1470.4
y: 754.4
width: 315.6001
x: 1
y: 638.2
width: 467.59998
height: 309.8
m_SerializedDataModeController:
m_DataMode: 0
......@@ -363,7 +363,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: f0660000
m_LastClickedID: 26352
m_ExpandedIDs: 00000000126300003263000030640000326400003464000036640000386400003a6400003c6400003e64000040640000426400004464000046640000486400004a640000
m_ExpandedIDs: 0000000016630000366300003464000036640000386400003a6400003c6400003e64000040640000426400004464000046640000486400004a6400004c6400004e640000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
......@@ -388,10 +388,10 @@ MonoBehaviour:
m_Icon: {fileID: 0}
m_ResourceFile:
m_AssetTreeState:
scrollPos: {x: 0, y: 1216.2}
scrollPos: {x: 0, y: 44}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: ffffffff00000000126300003263000030640000326400003464000036640000386400003a6400003c6400003e64000040640000426400004464000046640000486400004a640000
m_ExpandedIDs: ffffffff0000000016630000366300003464000036640000386400003a6400003c6400003e64000040640000426400004464000046640000486400004a6400004e64000090640000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
......@@ -467,9 +467,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1788
y: 135.2
width: 251.79993
x: 1775.4
y: 19
width: 258.19995
height: 929
m_SerializedDataModeController:
m_DataMode: 0
......@@ -514,9 +514,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1470.4
y: 135.2
width: 315.6001
x: 1
y: 19
width: 467.59998
height: 598.2
m_SerializedDataModeController:
m_DataMode: 0
......@@ -533,7 +533,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 34dbfeff7cdbfeffe8ddfeff02defeff36defeff8adefeff92defeffa0defeffb2defeffe6f9ffff
m_ExpandedIDs: cc92feff1693feff7c95feff8a95feffb295feff0296feff0a96feff1896feff2a96feff029ffeff4c9ffeffb2a1feffc0a1feffe8a1fefff2a3fefff4a3fefff6a3fefffca3feff76abfeffbeabfeff24aefeff32aefeff5aaefeff64b0feff66b0feff68b0feff6eb0feff6e25ffffb425ffff1a28ffff2828ffff5028ffffe42affffec2afffffa2affff0c2bffff76d2ffff7ed2ffff8cd2ffff9ed2ffffb8d4ffffc0d4ffffced4ffffe0d4ffffe6f9ffff72700000a4700000da700000ee700000347b00009c7b0000b07b0000e28900004a8a0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
......@@ -577,9 +577,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 576.8
y: 135.2
width: 891.6
x: 567.4
y: 19
width: 736.4
height: 929
m_SerializedDataModeController:
m_DataMode: 0
......@@ -926,9 +926,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 458.518, y: 1234.1746, z: -0.11622809}
m_Target: {x: 606.118, y: 1009.4162, z: -0.04727836}
speed: 2
m_Value: {x: 458.518, y: 1234.1746, z: -0.11622809}
m_Value: {x: 606.118, y: 1009.4162, z: -0.04727836}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
......@@ -978,9 +978,9 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 576.71204
m_Target: 627.76843
speed: 2
m_Value: 576.71204
m_Value: 627.76843
m_Ortho:
m_Target: 1
speed: 2
......@@ -1025,8 +1025,8 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1470.4
y: 135.2
x: 1568
y: 92
width: 315.6001
height: 598.2
m_SerializedDataModeController:
......@@ -1059,9 +1059,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 7.2000003
y: 135.2
width: 568.6
x: 0
y: 19
width: 565.4
height: 929
m_SerializedDataModeController:
m_DataMode: 0
......@@ -1105,7 +1105,7 @@ MonoBehaviour:
m_VAllowExceedBaseRangeMin: 1
m_VAllowExceedBaseRangeMax: 1
m_ScaleWithWindow: 0
m_HSlider: 0
m_HSlider: 1
m_VSlider: 1
m_IgnoreScrollWheelUntilClicked: 0
m_EnableMouseInput: 1
......@@ -1117,23 +1117,23 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 21
width: 568.6
width: 565.4
height: 908
m_Scale: {x: 0.525463, y: 0.525463}
m_Translation: {x: 284.3, y: 453.99997}
m_Scale: {x: 0.86220336, y: 0.86220336}
m_Translation: {x: 282.7, y: 453.99985}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
m_MarginBottom: 0
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -541.04663
y: -863.9999
width: 1082.0933
height: 1727.9999
x: -327.8809
y: -526.55774
width: 655.7618
height: 1053.1158
m_MinimalGUI: 1
m_defaultScale: 0.525463
m_LastWindowPixelSize: {x: 710.75, y: 1161.25}
m_LastWindowPixelSize: {x: 706.75, y: 1161.25}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 01000000000000000000
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment