示例#1
0
 public override void Refresh(InfoMap infos)
 {
     base.Refresh(infos);
     int index = (int)infos["index"];
     info = TerrainFlagInfo.Infos[index];
     SetMouseData();
 }
示例#2
0
        private static MethodParameterMap AddParameterMap(MapedObject aMap, InfoMap aPair, String methodName, Guid id, int paramCount)
        {
            var methodParams = aMap.MethodParameters.Where(x => x.MethodName.Equals(methodName) && x.ID == id).FirstOrDefault();

            if (methodParams == null)
            {
                methodParams                = new MethodParameterMap();
                methodParams.MethodName     = methodName;
                methodParams.ParameterCount = paramCount;
                if (aPair.RuleBased)
                {
                    methodParams.ParameterMaps.Add((ParameterMap)aPair);
                }
                else
                {
                    methodParams.ColumnParameterMaps.Add((ParameterColumnMap)aPair);
                }
                aMap.MethodParameters.Add(methodParams);
            }
            else if (aPair.RuleBased)
            {
                methodParams.ParameterMaps.Add((ParameterMap)aPair);
            }
            else if (!aPair.RuleBased)
            {
                methodParams.ColumnParameterMaps.Add((ParameterColumnMap)aPair);
            }

            return(methodParams);
        }
        public void OnEnable()
        {
            distanceFogColorDisplay.PopulateMap(serializedObject, "distanceColorSource");
            heightFogColorDisplay.PopulateMap(serializedObject, "heightColorSource");

            var settingsGroups = typeof(StylisticFog).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Where(x => x.GetCustomAttributes(typeof(StylisticFog.SettingsGroup), false).Any());

            foreach (var group in settingsGroups)
            {
                var searchPath = group.Name + ".";

                foreach (var setting in group.FieldType.GetFields(BindingFlags.Instance | BindingFlags.Public))
                {
                    var infoGroup = m_GroupFields.FirstOrDefault(x => x.name == group.Name);
                    if (infoGroup == null)
                    {
                        infoGroup             = new InfoMap();
                        infoGroup.properties  = new List <SerializedProperty>();
                        infoGroup.name        = group.Name;
                        infoGroup.distanceFog = group.FieldType == typeof(StylisticFog.DistanceFogSettings);
                        infoGroup.heightFog   = group.FieldType == typeof(StylisticFog.HeightFogSettings);
                        m_GroupFields.Add(infoGroup);
                    }


                    var property = serializedObject.FindProperty(searchPath + setting.Name);
                    if (property != null)
                    {
                        infoGroup.properties.Add(property);
                    }
                }
            }
        }
示例#4
0
 public void Load(SceneSetting data, string path = null)
 {
     DataPath = path;
     InfoMap infos = new InfoMap();
     infos["path"] = path;
     repo.New(data, EditorEvent.MAP_LOAD, infos);
     UpdateRemoteData();
 }
示例#5
0
        private void extractArgs(object[] args)
        {
            if (args == null)
                return;

            mouseDataType = (EditorMouseDataType)args[0];
            mouseData = (InfoMap)args[1];
            isHovered = (bool)args[2];
            hoverLocationX = (int)args[3];
            hoverLocationY = (int)args[4];
        }
示例#6
0
        public void ShowPanel(DetailsPanelType panelType, InfoMap infos)
        {
            DetailsPanelBase panel = panels[panelType];
            if (!showingPanels.Contains(panel))
            {
                showingPanels.Add(panel);
                panel.gameObject.SetActive(true);
            }

            panel.Refresh(infos);
        }
示例#7
0
 private void Awake()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
         return;
     }
     Instance = this;
     DontDestroyOnLoad(gameObject);
     LoadMapInfo();
 }
示例#8
0
        private void SetMouseData()
        {
            if (!ready)
                return;

            InfoMap infos = new InfoMap();
            infos["flag"] = info.Flag;
            infos["size"] = (int)BrushSizeSlider.value;
            infos["erase"] = erasing;

            GameObject preview = Instantiate(FillMarkPrefab) as GameObject;
            preview.GetComponent<SpriteRenderer>().color = info.Color;
            float scale = (BrushSizeSlider.value - 0.5f) * Mathf.Sqrt(3);
            preview.transform.localScale = new Vector3(scale, scale);

            EditorMouse.Instance.Clear();
            EditorMouse.Instance.SetData(EditorMouseDataType.TerrainFill, infos, preview);
        }
示例#9
0
        public void OnEnable(SerializedObject serializedObject, string path)
        {
            var topLevelSettings = typeof(SMAA).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Where(x => x.GetCustomAttributes(typeof(SMAA.TopLevelSettings), false).Any());
            var settingsGroups   = typeof(SMAA).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Where(x => x.GetCustomAttributes(typeof(SMAA.SettingsGroup), false).Any());

            foreach (var group in topLevelSettings)
            {
                var searchPath = path + "." + group.Name + ".";

                foreach (var setting in group.FieldType.GetFields(BindingFlags.Instance | BindingFlags.Public))
                {
                    var property = serializedObject.FindProperty(searchPath + setting.Name);
                    if (property != null)
                    {
                        m_TopLevelFields.Add(property);
                    }
                }
            }

            foreach (var group in settingsGroups)
            {
                var searchPath = path + "." + group.Name + ".";

                foreach (var setting in group.FieldType.GetFields(BindingFlags.Instance | BindingFlags.Public))
                {
                    var infoGroup = m_GroupFields.FirstOrDefault(x => x.name == group.Name);
                    if (infoGroup == null)
                    {
                        infoGroup              = new InfoMap();
                        infoGroup.properties   = new List <SerializedProperty>();
                        infoGroup.name         = group.Name;
                        infoGroup.quality      = group.FieldType == typeof(SMAA.QualitySettings);
                        infoGroup.experimental = group.GetCustomAttributes(typeof(SMAA.ExperimentalGroup), false).Length > 0;
                        m_GroupFields.Add(infoGroup);
                    }

                    var property = serializedObject.FindProperty(searchPath + setting.Name);
                    if (property != null)
                    {
                        infoGroup.properties.Add(property);
                    }
                }
            }
        }
示例#10
0
        private static Object NullableTypes(InfoMap paired, Object dataPoint)
        {
            Object result = null;

            switch (paired.DataType)
            {
            case "System.Double":
                Double?newDouble = new Double?((double)dataPoint);
                result = newDouble;
                break;

            case "System.Integer":
                int?newInteger = new int?((int)dataPoint);
                result = newInteger;
                break;

            case "System.Long":
                long?newLong = new long?((long)dataPoint);
                result = newLong;
                break;

            case "System.Single":
                Single?newSingle = new Single?((Single)dataPoint);
                result = newSingle;
                break;

            case "System.Float":
                float?newFloat = new float?((float)dataPoint);
                result = newFloat;
                break;

            case "System.Decimal":
                Decimal?newDecimal = new Decimal?((decimal)dataPoint);
                result = newDecimal;
                break;

            case "System.DateTime":
                DateTime?newDate = new DateTime?((DateTime)dataPoint);
                result = newDate;
                break;
            }

            return(result);
        }
        public void OnEnable(SerializedObject serializedObject, string path)
        {
            var topLevelSettings = typeof(SMAA).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Where(x => x.GetCustomAttributes(typeof(SMAA.TopLevelSettings), false).Any());
            var settingsGroups = typeof(SMAA).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Where(x => x.GetCustomAttributes(typeof(SMAA.SettingsGroup), false).Any());

            foreach (var group in topLevelSettings)
            {
                var searchPath = path + "." + group.Name + ".";

                foreach (var setting in group.FieldType.GetFields(BindingFlags.Instance | BindingFlags.Public))
                {
                    var property = serializedObject.FindProperty(searchPath + setting.Name);
                    if (property != null)
                        m_TopLevelFields.Add(property);
                }
            }

            foreach (var group in settingsGroups)
            {
                var searchPath = path + "." + group.Name + ".";

                foreach (var setting in group.FieldType.GetFields(BindingFlags.Instance | BindingFlags.Public))
                {
                    var infoGroup = m_GroupFields.FirstOrDefault(x => x.name == group.Name);
                    if (infoGroup == null)
                    {
                        infoGroup = new InfoMap();
                        infoGroup.properties = new List<SerializedProperty>();
                        infoGroup.name = group.Name;
                        infoGroup.quality = group.FieldType == typeof(SMAA.QualitySettings);
                        infoGroup.experimental = group.GetCustomAttributes(typeof(SMAA.ExperimentalGroup), false).Length > 0;
                        m_GroupFields.Add(infoGroup);
                    }

                    var property = serializedObject.FindProperty(searchPath + setting.Name);
                    if (property != null)
                    {
                        infoGroup.properties.Add(property);
                    }
                }
            }
        }
示例#12
0
 public Map1(ContentManager content) : base(content)
 {
     Info = new InfoMap()
     {
         Texture       = content.Load <Texture2D>("map1"),
         HeightTexture = 400f,
         WidthTexture  = 800f,
         Position      = new Vector2(0, 0),
     };
     AddObjects();
     Finish = new Wall(new InfoWall()
     {
         WidthTexture  = 35f,
         HeightTexture = 48f,
         Position      = new Vector2(782.5f, 376f),
     });
     Keys.Add(new Key(content, 111.5f, 65.5f));
     Keys.Add(new Key(content, 537f, 88f));
     Keys.Add(new Key(content, 216.5f, 353f));
 }
示例#13
0
        public InfoPage(int id)
        {
            InitializeComponent();
            Hostel hostel = Core.model.m_model.GetHostel(id);

            Name.Text    = hostel.h_name;
            Address.Text = hostel.address;
            Phone.Text   = Core.model.m_model.GetPhoneByHostelId(id);
            Site.Text    = hostel.site;

            var mapPosition = new Position(hostel.h_latitude, hostel.h_longitude); // center of Petersburg

            InfoMap.MoveToRegion(MapSpan.FromCenterAndRadius(mapPosition, Distance.FromMiles(1)));
            var pin = new Pin
            {
                Type     = PinType.Place,
                Position = mapPosition,
                Label    = hostel.h_name,
                Address  = hostel.address
            };

            InfoMap.Pins.Add(pin);
        }
示例#14
0
 private void Modify(string evt, InfoMap infos)
 {
     repo.Modify(evt, infos);
     GameEditor.Instance.FileModified = true;
 }
示例#15
0
        public void SetTerrainFlag(int x, int y, int radius, MapCellFlag flag, bool apply)
        {
            Dictionary<int, MapCellSetting> cellSettings = MapUtils.ArrayToDict(MapData.Cells);
            EditorMap map = GameEditor.Instance.Map;
            Vector2[] locations = MapUtils.Circle(x, y, radius);
            foreach (Vector2 location in locations)
            {
                MapCell cell = map.GetCell(location);
                if (cell == null)
                    continue;

                if (apply)
                {
                    MapCellSetting cellSetting;
                    if (!cellSettings.TryGetValue(cell.Key, out cellSetting))
                    {
                        cellSetting = new MapCellSetting();
                        cellSetting.X = cell.X;
                        cellSetting.Y = cell.Y;
                        cellSettings.Add(cell.Key, cellSetting);
                    }
                    EditorUtils.SetFlag(ref cellSetting.Flags, (int)flag, apply);
                }
                else
                {
                    MapCellSetting cellSetting;
                    if (cellSettings.TryGetValue(cell.Key, out cellSetting))
                    {
                        EditorUtils.SetFlag(ref cellSetting.Flags, (int)flag, apply);
                        if (cellSetting.Flags == 0)
                            cellSettings.Remove(cell.Key);
                    }
                }
            }

            MapData.Cells = MapUtils.DictToArray(cellSettings);

            InfoMap infos = new InfoMap();
            infos["flag"] = flag;
            Modify(EditorEvent.MAP_TERRAIN_UPDATE, infos);
        }
示例#16
0
        public void SetPathPoint(int pathIndex, int? pointIndex, int locationX, int locationY)
        {
            MapPathSetting path = MapData.Paths[pathIndex];
            MapWaypointSetting waypoint = new MapWaypointSetting();
            waypoint.X = locationX;
            waypoint.Y = locationY;

            if (pointIndex != null)
            {
                path.Waypoints[pointIndex.Value] = waypoint;
            }
            else
            {
                var waypoints = path.Waypoints.ToList<MapWaypointSetting>();
                waypoints.Add(waypoint);
                path.Waypoints = waypoints.ToArray();
            }

            InfoMap infos = new InfoMap();
            infos["index"] = pathIndex;
            Modify(EditorEvent.MAP_UPDATE_PATH, infos);
        }
示例#17
0
        public void SetPathColor(int index, float colorR, float colorG, float colorB)
        {
            MapPathSetting path = MapData.Paths[index];
            path.ColorR = colorR;
            path.ColorG = colorG;
            path.ColorB = colorB;

            InfoMap infos = new InfoMap();
            infos["index"] = index;
            Modify(EditorEvent.MAP_UPDATE_PATH, infos);
        }
示例#18
0
 public Maps(ContentManager content)
 {
     Info = new InfoMap();
 }
示例#19
0
        private void OperateSetPoint(int pathIndex, int? pointIndex)
        {
            operating = true;
            AddPathButton.color = EditorUtils.SelectedColor;
            EditorMouse mouse = EditorMouse.Instance;

            InfoMap data = new InfoMap();
            data["pathIndex"] = pathIndex;
            data["pointIndex"] = pointIndex;
            mouse.SetData(EditorMouseDataType.MapPath, data, pointIndex == 0 ? "Map/StartMark" : "Map/EndMark");
        }
示例#20
0
        private void StartOperate()
        {
            if (operating)
                return;

            operating = true;
            AddPathButton.color = EditorUtils.SelectedColor;
            EditorMouse mouse = EditorMouse.Instance;

            InfoMap data = new InfoMap();
            data["pathIndex"] = null;
            data["pointIndex"] = null;
            mouse.SetData(EditorMouseDataType.MapPath, data, "Map/StartMark");
        }
示例#21
0
 private void Modify(string evt, InfoMap infos)
 {
     repo.Modify(evt, infos);
     UpdateRemoteData();
 }
示例#22
0
        public void RemovePathPoint(int pathIndex, int pointIndex)
        {
            MapPathSetting path = MapData.Paths[pathIndex];
            if (path.Waypoints.Length == 1)
            {
                RemovePath(pathIndex);
                return;
            }

            var waypoints = path.Waypoints.ToList<MapWaypointSetting>();
            waypoints.RemoveAt(pointIndex);
            path.Waypoints = waypoints.ToArray();

            InfoMap infos = new InfoMap();
            infos["index"] = pathIndex;
            Modify(EditorEvent.MAP_UPDATE_PATH, infos);
        }
示例#23
0
        private void SelectEntry(int index)
        {
            DeselectEntry();
            GameObject entryObj = Content.GetChild(index + 1).gameObject;
            selectedEntry = entryObj.GetComponent<TerrainEntry>();
            selectedEntry.Select();

            InfoMap infos = new InfoMap();
            infos["index"] = index;
            DetailsPanels.Instance.ShowPanel(DetailsPanelType.Terrain, infos);

            if (GameEditor.Instance.Map != null)
                GameEditor.Instance.Map.ToggleShowTerrain(selectedEntry.Flag, true);
        }
示例#24
0
 virtual public void Refresh(InfoMap infos)
 {
 }