示例#1
0
    /* ----------------------------------
     * INIT: Used for late initialization after constructor
     * ----------------------------------*/
    void Init()
    {
        EditorApplication.update += this.Update;

        place.DataStructure  = HelperExtention.GetOrCreateSObjectReturn <StructSearchData>(ref place.DataStructure, PATH_SAVE_SCRIPTABLE_OBJECT);
        place.namePlaceСache = "";
        place.DataStructure.dataChache.Clear();

        addressDropdown = new DropDown("Address");
        map             = new GUIMap();
        map.Repaint    += Repaint;
        map.Zoom        = 19;

        geometriesReorderableList = new ReorderableList(new ArrayList(), typeof(GMLGeometry), true, true, true, true);
        geometriesReorderableList.drawHeaderCallback  += DrawGMLGeometryHeader;
        geometriesReorderableList.drawElementCallback += DrawGMLGeometry;
        geometriesReorderableList.onAddCallback       += AddGMLGeometry;
        geometriesReorderableList.onRemoveCallback    += RemoveGMLGeometry;
        geometriesReorderableList.onReorderCallback   += ReorderGMLGeometries;

        // Creating the geometry list
        geometries = new List <GMLGeometry>();
        // Set geometries list reference
        geometriesReorderableList.list = geometries;
        map.Geometries = geometries;
    }
示例#2
0
        //private string str;
        void OnEnable()
        {
            place = target as SearchPlace;
            place.DataStructure  = HelperExtention.GetOrCreateSObjectReturn <StructSearchData>(ref place.DataStructure, PATH_SAVE_SCRIPTABLE_OBJECT);
            place.namePlaceСache = "";
            //   place.namePlace = "";

            /*if (place.namePlace!=String.Empty)
             * {
             *  place.SearchInMapzen();
             * }
             * else
             * {
             *  place.DataStructure.dataChache.Clear();
             * }*/
        }
示例#3
0
        /* --------------------------------
         * Constructor
         * ------------------------------*/
        public PlaceSearcher(string label)
        {
            addressDropdown = new DropDown(label);

            // Get existing open window or if none, make a new one:
            place = UnityEngine.Object.FindObjectOfType <SearchPlace>();
            if (place == null)
            {
                SearchPlace search = new GameObject("Searcher").AddComponent <SearchPlace>();
                place = search;
            }

            place.DataStructure  = HelperExtention.GetOrCreateSObjectReturn <StructSearchData>(ref place.DataStructure, PATH_SAVE_SCRIPTABLE_OBJECT);
            place.namePlaceСache = "";
            place.DataStructure.dataChache.Clear();

            EditorApplication.update += this.Update;
        }