2024-12-01 04:58:16 +08:00
|
|
|
|
using Newtonsoft.Json;
|
2024-11-29 09:44:45 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class SceneItem : MonoBehaviour
|
|
|
|
|
{
|
2024-12-12 15:21:07 +08:00
|
|
|
|
public string sceneId;
|
2024-12-01 17:51:09 +08:00
|
|
|
|
public int sceneType;
|
2024-11-29 09:44:45 +08:00
|
|
|
|
public Text sceneName;
|
|
|
|
|
public Image sceneImage;
|
|
|
|
|
public Image maskImage;
|
2024-12-01 04:58:16 +08:00
|
|
|
|
public string roleLimit;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public int limitNum;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-12 15:21:07 +08:00
|
|
|
|
public string dutyId;
|
2024-12-01 04:58:16 +08:00
|
|
|
|
public JSONReader jsonReader;
|
2024-11-29 09:44:45 +08:00
|
|
|
|
public bool IsOpen { get; set; } = true;
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
2024-12-01 04:58:16 +08:00
|
|
|
|
jsonReader = GameObject.Find("JsonObj").GetComponent<JSONReader>();
|
2024-11-29 09:44:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2024-12-01 04:58:16 +08:00
|
|
|
|
//<2F>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public void SetData()
|
|
|
|
|
{
|
|
|
|
|
foreach (var npc in jsonReader.locationDictionary)
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("111111111111" + npc.Value.RoleLimit);
|
|
|
|
|
// ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>ŷָ<C5B7> RoleLimit <20>ֶ<EFBFBD>
|
|
|
|
|
string roleLimit = npc.Value.RoleLimit;
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD> RoleLimit <20><><EFBFBD>ǿ<EFBFBD><C7BF>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ն<EFBFBD><D5B6>ŷָ<C5B7>
|
|
|
|
|
if (!string.IsNullOrEmpty(roleLimit))
|
|
|
|
|
{
|
|
|
|
|
string[] roleLimits = roleLimit.Split(',');
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>Ľ<EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
|
|
|
|
|
foreach (string role in roleLimits)
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("RoleLimit Item: " + role);
|
|
|
|
|
|
|
|
|
|
// <20>жϽ<D0B6>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ -1
|
|
|
|
|
if (role == "-1")
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("<22><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>Ϊ-1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>ޣ<EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("RoleLimit is empty for NPC ID: " + npc.Key);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-29 09:44:45 +08:00
|
|
|
|
}
|