Exemple #1
0
 /// <summary>
 /// Sets the UserControl for the Map Class and start it as a minimap
 /// </summary>
 public void SetMiniMapControls(MiniMapControl miniMap, Map mainMap)
 {
     Debug.Assert(_isMiniMap);
     _control = miniMap;
     _control.SetMap(this);
     miniMap.SetMap(this, mainMap);
 }
Exemple #2
0
    public void InitMiniMap()
    {
        InputRepeater repeater;

        //lowerleft acts as the whole map
        lowerLeft = transform.Find("FrameLowerLeft");
        miniMapCollision = lowerLeft.gameObject.AddComponent<BoxCollider>();
        repeater = lowerLeft.gameObject.AddComponent<InputRepeater>();
        repeater.SetTarget(transform);

        //upper left is nothing
        upperLeft = transform.Find("FrameLowerLeft/FrameUpperLeft");

        //upper right is nothing
        upperRight = transform.Find("FrameLowerLeft/FrameUpperRight");

        //lower right is nothing
        lowerRight = transform.Find("FrameLowerLeft/FrameLowerRight");

        resizeButton = transform.Find("FrameLowerLeft/FrameLowerRight/Resize");
        resizeButton.gameObject.AddComponent<BoxCollider>();
        repeater = resizeButton.gameObject.AddComponent<InputRepeater>();
        repeater.SetTarget(transform);

        centerMiniMap = transform.Find("FrameLowerLeft/Centered");
        centerMiniMap.gameObject.AddComponent<BoxCollider>();
        repeater = centerMiniMap.gameObject.AddComponent<InputRepeater>();
        repeater.SetTarget(transform);

        zoomHandle = transform.Find("FrameLowerLeft/FrameUpperRight/ZoomHandle");
        zoomHandle.gameObject.AddComponent<BoxCollider>();
        repeater = zoomHandle.gameObject.AddComponent<InputRepeater>();
        repeater.SetTarget(transform);

        miniMapCamera = GameObject.FindGameObjectWithTag("MiniMapCamera").camera;
        miniMapControl = miniMapCamera.transform.parent.GetComponent<MiniMapControl>();

        Resize();
    }
Exemple #3
0
 public void InitializeMaps(MapControl mapControl, MiniMapControl miniMapControl)
 {
     Map.SetMapControl(mapControl);
     _miniMap.SetMiniMapControls(miniMapControl, Map);
 }