示例#1
0
    //从数据库中读取起止点相关信息,并将起点颜色信息,止点颜色信息提取出来
    void ReadSSPTable()
    {
        Model[] models = SceneModels.instance.Get_scope_models();
        local_db = new DbRepository <StartStopInfo>();
        local_db.CreateDb(db_path);
        var tmpssp = local_db.Select <StartStopInfo>((mod_name) =>
        {
            if (mod_name != null)
            {
                //DebugLog.DebugLogInfo(string.Format("起点({0},{1},{2}),止点({3},{4},{5})", mod_name.qr, mod_name.qg, mod_name.qb, mod_name.zr, mod_name.zg, mod_name.zb));
                return(true);
            }
            else
            {
                return(false);
            }
        });

        sspInfoList = new List <StartStopInfo>();

        foreach (StartStopInfo tmp in tmpssp)
        {
            for (int i = 0; i < models.Length; i++)
            {
                if (tmp.mod_name == models[i].name)
                {
                    sspInfoList.Add(tmp);
                }
            }
        }

        local_db.Close();
        for (int i = 0; i < sspInfoList.Count; i++)
        {
            StartStopPoint point = new StartStopPoint(sspInfoList[i]);
            sspList.Add(point);


            GameObject tempMark = Instantiate(Resources.Load <GameObject>("Prefab/SSPElement"));
            // DebugLog.DebugLogInfo("读取下方菜单预制体");
            tempMark.transform.SetParent(Parent.transform);
            tempMark.transform.localScale    = Vector3.one;
            tempMark.transform.localPosition = new Vector3(tempMark.transform.localPosition.x, tempMark.transform.localPosition.y, 1);
            // Debug.Log(tempMark);
            tempMark.GetComponent <StartStopElement>().SetData(sspInfoList[i]);
            tempMark.GetComponentInChildren <Text>().text = sspInfoList[i].ch_name;
            sspEleList.Add(tempMark.GetComponent <StartStopElement>());

            //muscleList.Add(sspInfoList[i].ch_name);
        }
    }
示例#2
0
    public void SetData(StartStopInfo info)

    {
        sspinfo = info;
        point   = new StartStopPoint(info);

        modName  = info.mod_name;
        chName   = info.ch_name;
        enName   = info.en_name;
        startDes = info.start_desc;
        stopDes  = info.stop_desc;
        try
        {
            m_params = JsonConvert.DeserializeObject <camera_params>(info.camera_params);
        }
        catch (System.Exception)
        {
        }
    }