Commit a4fce68d authored by shujianhe's avatar shujianhe

void onNativeHashKeyValue(string json)

    {
        var temp = JsonUtility.FromJson<NativeHashKey>(json);
        utilsTools.setGDataByKey(temp.key, temp.value);
    }添加底层动态设置keyvalue
parent 01c3aa50
......@@ -4,7 +4,11 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
class NativeHashKey
{
public string key;
public string value;
}
public class Native : MonoBehaviour
{
public Text text;
......@@ -51,10 +55,17 @@ public class Native : MonoBehaviour
void jumpGame(string json)
{
Debug.Log("JSON:" + json);
utilsTools.setGDataByKey("first1", false);
utilsTools.setGDataByKey("NativeGameData", JsonUtility.FromJson<netLableImageItem>(json));
SceneManager.LoadScene("Scenes/gameScene");
SceneManager.LoadScene(utilsTools.getGameSceneName());
}
void onNativeHashKeyValue(string json)
{
var temp = JsonUtility.FromJson<NativeHashKey>(json);
utilsTools.setGDataByKey(temp.key, temp.value);
}
......
......@@ -37,6 +37,10 @@ public class utilsTools
globalDatas.Add(key, obj);
}
}
public static string getGameSceneName()
{
return "Scenes/gameScene";
}
public static bool removeGDataByKey(string key)
{
if( globalDatas.ContainsKey(key))
......
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