Exemplo n.º 1
0
        /// <Summary>
        /// Get executed flag list from event data.
        /// </Summary>
        void GetExecutedFlagList()
        {
            List <string> flagNameList = new List <string>();

            string dataType = "EventMasterData";

            string[] guidArray = MapEditorUtil.GetGuidArray(dataType);

            foreach (string guid in guidArray)
            {
                string          path      = AssetDatabase.GUIDToAssetPath(guid);
                EventMasterData eventData = AssetDatabase.LoadAssetAtPath <EventMasterData>(path);
                if (eventData == null)
                {
                    continue;
                }

                if (eventData.eventParts == null)
                {
                    continue;
                }
                foreach (AriadneEventParts parts in eventData.eventParts)
                {
                    if (parts == null)
                    {
                        continue;
                    }
                    if (parts.hasExecutedFlag && parts.executedFlagName != "")
                    {
                        flagNameList.Add(parts.executedFlagName);
                    }
                }
            }
            flagNames = flagNameList.ToArray();
        }
Exemplo n.º 2
0
        /// <Summary>
        /// Show setting GUI about destination map that relates move position event.
        /// </Summary>
        void ShowSelectDestinationMapParts()
        {
            if (!isShowMap || editingEventParts.destMap == null || editingEventParts.destDungeon == null)
            {
                return;
            }

            int horizontal = editingEventParts.destMap.floorSizeHorizontal;
            int vertical   = editingEventParts.destMap.floorSizeVertical;

            mapBg = MapEditorUtil.RepaintMapTexture(horizontal, vertical, cellSize, gridColor, baseColor);
            EditorGUILayout.BeginVertical("Box");
            {
                GUIContent content = new GUIContent(mapBg);
                GUILayout.Box(content);

                Rect mapRect = GUILayoutUtility.GetLastRect();
                Rect[,] iconRect = MapEditorUtil.GetMapRectArray(mapRect, horizontal, vertical, cellSize);
                SetMapAttrIconToMap(iconRect, editingEventParts.destMap.mapInfo, horizontal, vertical);
                Rect[,] highlightRect = MapEditorUtil.GetMapRectArray(mapRect, horizontal, vertical, cellSize);
                if (isPosSelected)
                {
                    SetHoverColor(highlightRect[selectedGridPos.x, selectedGridPos.y], selectedTex);
                }

                wantsMouseMove = true;
                if (mapRect.Contains(Event.current.mousePosition))
                {
                    Vector2 pos = new Vector2(Event.current.mousePosition.x - mapRect.position.x, Event.current.mousePosition.y - mapRect.position.y);
                    hoverGridPos = MapEditorUtil.GetPosInGrid(pos, horizontal, vertical, cellSize);
                    SetHoverColor(highlightRect[hoverGridPos.x, hoverGridPos.y], hoverTex);

                    if (Event.current.type == EventType.MouseUp)
                    {
                        Undo.RecordObject(this, undoName);
                        selectedGridPos = MapEditorUtil.GetPosInGrid(pos, horizontal, vertical, cellSize);
                        isPosSelected   = true;
                    }
                    Repaint();
                }
            }
            EditorGUILayout.EndVertical();
        }
Exemplo n.º 3
0
        /// <Summary>
        /// Search floor map data in the project and set it to the list.
        /// </Summary>
        void SetFloorMapDataList()
        {
            floorMapDataList = new List <FloorMapMasterData>();

            string dataType = "FloorMapMasterData";

            string[] guidArray = MapEditorUtil.GetGuidArray(dataType);

            foreach (string guid in guidArray)
            {
                string             path      = AssetDatabase.GUIDToAssetPath(guid);
                FloorMapMasterData floorData = AssetDatabase.LoadAssetAtPath <FloorMapMasterData>(path);
                if (floorData == null)
                {
                    continue;
                }
                if (floorData.name != MapEditorUtil.tempFileName)
                {
                    floorMapDataList.Add(floorData);
                }
            }
        }
Exemplo n.º 4
0
        /// <Summary>
        /// Search event data in the project and set it to the list.
        /// </Summary>
        void SetEventMasterDataList()
        {
            eventDataList = new List <EventMasterData>();

            string dataType = "EventMasterData";

            string[] guidArray = MapEditorUtil.GetGuidArray(dataType);

            foreach (string guid in guidArray)
            {
                string          path      = AssetDatabase.GUIDToAssetPath(guid);
                EventMasterData eventData = AssetDatabase.LoadAssetAtPath <EventMasterData>(path);
                if (eventData == null)
                {
                    continue;
                }
                if (eventData.eventId > 0)
                {
                    eventDataList.Add(eventData);
                }
            }
        }
Exemplo n.º 5
0
        /// <Summary>
        /// Get an item list from item data.
        /// </Summary>
        void GetTreasureItemList()
        {
            List <int>    itemIdList   = new List <int>();
            List <string> itemNameList = new List <string>();

            string dataType = "ItemMasterData";

            string[] guidArray = MapEditorUtil.GetGuidArray(dataType);

            foreach (string guid in guidArray)
            {
                string         path     = AssetDatabase.GUIDToAssetPath(guid);
                ItemMasterData itemData = AssetDatabase.LoadAssetAtPath <ItemMasterData>(path);
                if (itemData == null)
                {
                    continue;
                }
                itemIdList.Add(itemData.itemId);
                itemNameList.Add(itemData.itemName);
            }
            itemIds   = itemIdList.ToArray();
            itemNames = itemNameList.ToArray();
        }
Exemplo n.º 6
0
 /// <Summary>
 /// Set up map icons.
 /// </Summary>
 void SetMapIconArray()
 {
     mapIconList = MapEditorUtil.GetMapIconArray();
 }