Commit 6c045fb5 authored by shujianhe's avatar shujianhe

1

parent dcfc56ba
......@@ -13,4 +13,34 @@ namespace Assets.scripts.Datas
public string name;
public string path = "";//暂时空
}
public class SettnigToGame
{
//{"uid":"876511","highlightId":0,"coloredPictures":0,"autoSwitch":0,"fillAnimation":0,"vibration":0}
public string uid;
public int highlightId = 0;
public int coloredPictures = 0;
public int autoSwitch = 0;
public int fillAnimation = 0;
public int vibration = 0;
public string getHighlightId()
{
return highlightId.ToString();
}
public string getColoredPictures()
{
return coloredPictures.Equals(0) ? "false" : "true";
}
public string getAutoSwitch()
{
return autoSwitch.Equals(0) ? "false" : "true";
}
public string getFillAnimation()
{
return fillAnimation.Equals(0) ? "false" : "true";
}
public string getVibration()
{
return vibration.Equals(0) ? "false" : "true";
}
}
}
using Assets.scripts.Datas;
using System;
using System.Collections;
using System.Collections.Generic;
......@@ -71,7 +72,17 @@ public class Native : MonoBehaviour
SceneManager.LoadScene(utilsTools.getGameSceneName());
}
void setSettings(String json)
{
SettnigToGame settnigToGame = JsonUtility.FromJson<SettnigToGame>(json);
utilsTools.setGDataByKey("auto_switch", settnigToGame.getAutoSwitch());
utilsTools.setGDataByKey("vibration", settnigToGame.getVibration());
utilsTools.setGDataByKey("highlight_areas", settnigToGame.getHighlightId());
utilsTools.setGDataByKey("uid", settnigToGame.uid);
utilsTools.setGDataByKey("fillanimation", settnigToGame.getFillAnimation());
}
void onNativeHashKeyValue(string json)
{
var temp = JsonUtility.FromJson<NativeHashKey>(json);
......
......@@ -49,9 +49,9 @@ public class mainGameView : MonoBehaviour
[SerializeField]
protected int selectTextureIdx = 1;
static protected string[] allSelectTexturePaths = {
"scenes/game/cells/grayCell",
"scenes/game/cells/buleCell",
"scenes/game/cells/gray",
"scenes/game/cells/grayCell"
};
private ColorIndexTables nowSelectColors = null;
public int SelectTextureIdx
......@@ -192,19 +192,19 @@ public class mainGameView : MonoBehaviour
resetSize();
onInitEndHandler();
if (thumbnailTexture2d != null) {
utilsTools.addTimer_Update(gameObject, "shouhuThumbnailIsChange", (String _) =>
{
if (thumbnailIsChange == true)
{
thumbnailIsChange = false;
thumbnailTexture2d.SetPixels(allColor["thumbnail"]);
string path = gameScenUseInfo.getLocalThumbnailPath();
var sltTextureSize = utilsTools.getGDataByKey<Vector2>("sltTextureSize", Vector2.one);
//utilsTools.saveByteToPath(utilsTools.ScaleTexture(thumbnailTexture2d, Convert.ToInt32(sltTextureSize.x), Convert.ToInt32(sltTextureSize.y)).EncodeToJPG(), path);
//utilsTools.saveByteToPath(thumbnailTexture2d.EncodeToJPG(), path);
}
return true;
}, 120, 0);
//utilsTools.addTimer_Update(gameObject, "shouhuThumbnailIsChange", (String _) =>
//{
// if (thumbnailIsChange == true)
// {
// thumbnailIsChange = false;
// thumbnailTexture2d.SetPixels(allColor["thumbnail"]);
// string path = gameScenUseInfo.getLocalThumbnailPath();
// var sltTextureSize = utilsTools.getGDataByKey<Vector2>("sltTextureSize", Vector2.one);
// utilsTools.saveByteToPath(utilsTools.ScaleTexture(thumbnailTexture2d, Convert.ToInt32(sltTextureSize.x), Convert.ToInt32(sltTextureSize.y)).EncodeToJPG(), path);
// utilsTools.saveByteToPath(thumbnailTexture2d.EncodeToJPG(), path);
// }
// return true;
//}, 120, 0);
}
}
protected string getSelectPathByGid(int gid)
......@@ -1235,7 +1235,7 @@ public class mainGameView : MonoBehaviour
}
protected virtual void drawThumbnailByAid(List<short> aids)
{
if (false)
if (true)
{
TaskItemBack taskItemBack = (System.Object[] parmass) =>
{
......@@ -1316,8 +1316,18 @@ public class mainGameView : MonoBehaviour
}
public void onClear()
{
if(thumbnailTexture2d != null)
if (thumbnailTexture2d != null)
{
thumbnailTexture2d.SetPixels(allColor["thumbnail"]);
string path = gameScenUseInfo.getLocalThumbnailPath();
var sltTextureSize = new Vector2(400, 400);// utilsTools.getGDataByKey<Vector2>("sltTextureSize", Vector2.one);
if (thumbnailTexture2d.width.Equals(thumbnailTexture2d.height) == false)
{
sltTextureSize = new Vector2(200, 400);
}
utilsTools.saveByteToPath(utilsTools.ScaleTexture(thumbnailTexture2d, Convert.ToInt32(sltTextureSize.x), Convert.ToInt32(sltTextureSize.y)).EncodeToJPG(), path);
utilsTools.saveByteToPath(thumbnailTexture2d.EncodeToJPG(), path);
Destroy(thumbnailTexture2d);
thumbnailTexture2d = null;
}
......
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