public void LoadExperiment(ExperimentalInfo info)
        {
            resourceLoad.LoadExperimentalInfo(info);

            //初始化所有编辑器
            SceneEditorManager.Init();
            EventEditorManager.Init();
            ObjectEditorManager.Init();
        }
Beispiel #2
0
    public ExperimentalInfo GetExperimentalInfo()
    {
        ExperimentalInfo info = new ExperimentalInfo();

        info.CL_Objects = new List <CL_Object>(CL_Objects.Values);
        info.Operations = Operations;
        foreach (var t in SceneObjects)
        {
            CLGameObject clg = t.GetComponent <CLGameObject>();
            info.SceneObjects.Add(clg.cl_object);
        }
        info.EventClassifys = new List <string>(EventInfos.Keys);
        info.EventInfos     = new List <List <EventInfo> >(EventInfos.Values);
        return(info);
    }
Beispiel #3
0
    public void LoadExperimentalInfo(ExperimentalInfo info)
    {
        //加载模板物体
        CL_Objects.Clear();
        foreach (var t in info.CL_Objects)
        {
            CL_Objects.Add(t.Name, t);
        }
        //加载操作
        Operations = info.Operations;

        //加载场景信息
        LoadSceneObjects(info.SceneObjects);

        //加载事件
        EventInfos.Clear();
        for (int i = 0; i < info.EventClassifys.Count; i++)
        {
            EventInfos.Add(info.EventClassifys[i], info.EventInfos[i]);
        }
    }
        public void CreateExperiment()
        {
            ExperimentalInfo info = new ExperimentalInfo();

            //烧杯
            info.CL_Objects.Add(new CL_Object
            {
                Name       = "烧杯",
                Model      = 0,
                ModelSize  = 1,
                Operations = new List <Operation>()
                {
                    new Operation {
                        Name = "Move"
                    }
                },
                Type         = CL_ObjType.Vessel,
                Liquidvolume = 0,
            });
            //玻璃棒
            info.CL_Objects.Add(new CL_Object
            {
                Name       = "玻璃棒",
                Model      = 1,
                ModelSize  = 1,
                Operations = new List <Operation>()
                {
                    new Operation {
                        Name = "Move"
                    }
                },
                Type = CL_ObjType.Common
            });
            //量筒
            info.CL_Objects.Add(new CL_Object
            {
                Name       = "量筒",
                Model      = 2,
                ModelSize  = 1,
                Operations = new List <Operation>()
                {
                    new Operation {
                        Name = "Move"
                    }
                },
                Type = CL_ObjType.Vessel
            });
            //烧瓶
            info.CL_Objects.Add(new CL_Object
            {
                Name       = "烧瓶",
                Model      = 3,
                ModelSize  = 1,
                Operations = new List <Operation>()
                {
                    new Operation {
                        Name = "Move"
                    }
                },
                Type = CL_ObjType.Vessel
            });
            //锥形瓶
            info.CL_Objects.Add(new CL_Object
            {
                Name       = "锥形瓶",
                Model      = 4,
                ModelSize  = 1,
                Operations = new List <Operation>()
                {
                    new Operation {
                        Name = "Move"
                    }
                },
                Type = CL_ObjType.Vessel
            });
            //试管
            info.CL_Objects.Add(new CL_Object
            {
                Name       = "试管",
                Model      = 5,
                ModelSize  = 1,
                Operations = new List <Operation>()
                {
                    new Operation {
                        Name = "Move"
                    }
                },
                Type = CL_ObjType.Vessel
            });
            info.Operations.Add(new Operation()
            {
                Name = "Move"
            });
            info.Operations.Add(new Operation()
            {
                Name = "Hold"
            });
            info.Operations.Add(new Operation()
            {
                Name = "Rota"
            });
            info.Operations.Add(new Operation()
            {
                Name = "Pull"
            });
            info.Operations.Add(new Operation()
            {
                Name = "Other1"
            });
            info.EventClassifys.Add("默认");
            info.EventInfos.Add(new List <EventInfo>()
            {
                new EventInfo()
                {
                    Name      = "初始化",
                    Remark    = "这是一个事件案列",
                    EventType = CLEventType.GameInitialize,
                    Action    = new CLAction {
                        type   = CLActionType.ShowTip,
                        values = new CLValue[2] {
                            new CLValue()
                            {
                                value = "欢迎来到化学实验室"
                            },
                            null
                        }
                    }
                },
            });
            LoadExperiment(info);
        }