Ejemplo n.º 1
0
    IEnumerator LoadEvacuationArea()
    {
        Logger.Instance.WriteLog("加载疏散区域信息");
        EvacuationPlanDao   ePlanDao     = new EvacuationPlanDao();
        List <EvacuateArea> evacuateArea = ePlanDao.Select001();
        GameObject          goArea       = null;
        GameObject          areaText     = null;

        foreach (var area in evacuateArea)
        {
            goArea = DrawArea(area);
            if (goArea == null)
            {
                continue;
            }
            areaText = SetEvacuateAreaText(area);
            AdjustTextAlignment(goArea, areaText);
            DicAreaIdAndAreaGo[area.id]     = goArea;
            DicAreaIdAndAreaNameGo[area.id] = areaText;
            TweenColor tc = goArea.AddComponent <TweenColor>();
            tc.style = UITweener.Style.PingPong;
            tc.from  = new Color(0, 1, 0, 0.5f);
            tc.to    = new Color(1, 0, 0, 0.5f);
            goArea.SetActive(false);
            areaText.SetActive(false);
            Areas.Add(goArea);
            AreaTexts.Add(areaText);
        }

        yield return(null);
    }
Ejemplo n.º 2
0
    //从数据库加载疏散预案数据
    IEnumerator LoadData()
    {
        Logger.Instance.WriteLog("从数据库加载疏散预案数据");
        EvacuationPlanDao   epDao     = new EvacuationPlanDao();
        List <EvacuateArea> eAreaList = epDao.Select001();

        foreach (var area in eAreaList)
        {
            AddItemToEvacuateAreaItemGrid(area);
        }
        if (eAreaList.Count > 0)
        {
            EvacuateAreaDevicePanel.SetActive(true);
            EvacuateAreaListGrid.GetChild(0).GetComponent <EditedEvacuateAreaListItem>().Selected();
        }
        yield return(null);
    }
Ejemplo n.º 3
0
    IEnumerator LoadData()
    {
        Logger.Instance.WriteLog("加载疏散预案");
        yield return(new WaitForEndOfFrame());

        EvacuationPlanDao         epDao      = new EvacuationPlanDao();
        List <EvacuateAreaOfPlan> eaoPlanLst = epDao.Select002(planId);
        List <string>             areaIdLst  = new List <string>();

        foreach (var item in eaoPlanLst)
        {
            areaIdLst.Add(item.evacuateAreaId);
        }
        Logger.Instance.WriteLog("加载疏散区域");
        List <EvacuateArea> evacuateAreaLst = epDao.Select001();

        InitEvacuateAreaOfPlanItems(evacuateAreaLst, areaIdLst);
        EvacuateAreaOfPlanItemGrid.gameObject.GetComponent <UIWidget>().UpdateAnchors();
        yield return(null);
    }