private void Awake() { DontDestroyOnLoad(this); if (Instance) { Debug.LogWarning("uimanager is aready exsit,please keep one"); } Instance = this; mainCamera = Camera.main; ResManager.LoadAsync("UI/UITips", (res) => { tipRes = res as GameObject; }); tips.Init(() => { if (tipRes) { var go = Instantiate(tipRes); var tip = go.GetComponent <UITips>(); AddWidget(go); return(tip); } return(null); }); }
// Use this for initialization void Start() { mapData = ResManager.Load(assetPath) as MapData; indicators.Init(() => { GameObject go = Instantiate <GameObject>(ResManager.Load("CanMove") as GameObject); var indicator = go.GetComponent <MapCellIndicator>(); return(indicator); }); //string data = ta.text; //mapData = LitJson.JsonMapper.ToObject<MapData>(data); pool = new GameObject("pool"); mapRoot = new GameObject("mapRoot"); GenMap(); GenActors(); AutoSelectPlayer(); state = State.Area; }