Пример #1
0
    // Use this for initialization
    void Start()
    {
        resourcePath  = Application.dataPath + "/Resources/";
        mapController = GetComponent <MapController>();
        mapLayersUI   = GetComponent <MapLayersUI>();
        rayCastLayer  = 1;
        addIgorePathList();

        canBuildCube    = Instantiate(canBuildCubePrefab, farAwayPos, Quaternion.identity) as GameObject;
        canNotBuildCube = Instantiate(canNotBuildCubePrefab, farAwayPos, Quaternion.identity) as GameObject;
        canNotMoveInst  = new GameObject("CanNotMoveDebugCube");
        canNotMoveInst.transform.position = Vector3.zero;
        canNotMoveInst.transform.rotation = Quaternion.identity;

        updateCategoryList();

        mouseControl    = new MapMouseEditor[5];
        mouseControl[0] = new MapMouseClick(mapController, mapPatternImporter);
        mouseControl[1] = new MapMouseHold(mapController, mapPatternImporter);
        mouseControl[2] = new MapMouseSquare(mapController, mapPatternImporter, SquareBuildCubePrefab);
        mouseControl[3] = new MapMouseConnection(mapController, mapPatternImporter, SquareBuildCubePrefab);
        mouseControl[4] = new MapMouseRandomizer(mapController, mapPatternImporter, SquareBuildCubePrefab);

        string[] sceneName = getSceneNames();
        SceneDropdown.options.Clear();
        foreach (var item in sceneName)
        {
            SceneDropdown.options.Add(new Dropdown.OptionData(item));
        }

        DrawGrid();

        OnNeedGameObjectActive(CreateSceneUI);
    }
Пример #2
0
        /// <summary>
        /// Raises the OnMapMouseClick event.
        /// </summary>
        /// <param name="e"></param>
        private void RaiseOnMapMouseClick(MouseEventArgs e)
        {
            var geoCoordinates = _mapSceneManager.ToGeoCoordinates(e.GetPosition(this));
            var args           = new MapControlEventArgs(e, geoCoordinates);

            OnMapMouseClick(args);
            MapMouseClick?.Invoke(this, args);
        }