Esempio n. 1
0
    public override void OnInspectorGUI()
    {
        EditorGUILayout.Space();
        markerFab     = (GameObject)EditorGUILayout.ObjectField("Marker Node Prefab", markerFab, typeof(GameObject), false);
        markerLayout  = (MapNav.TilesLayout)EditorGUILayout.EnumPopup("Marker Layout", markerLayout);
        markerSpacing = EditorGUILayout.FloatField("Marker Node Spacing", markerSpacing);
        markerSize    = EditorGUILayout.FloatField("Marker Node Size", markerSize);
        EditorGUILayout.BeginHorizontal();
        markerRadius = EditorGUILayout.IntField("Marker Radius", markerRadius);
        if (GUILayout.Button("-"))
        {
            markerRadius--; RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius);
        }
        if (GUILayout.Button("+"))
        {
            markerRadius++; RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius);
        }
        EditorGUILayout.EndHorizontal();

        //  update the marker with new values
        EditorGUILayout.Space();
        if (GUILayout.Button("Update"))
        {
            RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius);
        }
    }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        EditorGUILayout.Space();
        markerFab         = (GameObject)EditorGUILayout.ObjectField("Marker Node Prefab", markerFab, typeof(GameObject), false);
        markerLayout      = (MapNav.TilesLayout)EditorGUILayout.EnumPopup("Marker Layout", markerLayout);
        markerSpacing     = EditorGUILayout.FloatField("Marker Node Spacing", markerSpacing);
        markerSize        = EditorGUILayout.FloatField("Marker Node Size", markerSize);
        adaptToTileHeight = EditorGUILayout.Toggle("Adapt to Tile Height", adaptToTileHeight);
        GUI.enabled       = adaptToTileHeight;
        tilesMask         = EditorGUILayout.LayerField("Tiles Layer", tilesMask);
        GUI.enabled       = true;
        EditorGUILayout.BeginHorizontal();
        markerRadius = EditorGUILayout.IntField("Marker Radius", markerRadius);
        if (GUILayout.Button("-"))
        {
            markerRadius--; RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius, adaptToTileHeight, tilesMask);
        }
        if (GUILayout.Button("+"))
        {
            markerRadius++; RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius, adaptToTileHeight, tilesMask);
        }
        EditorGUILayout.EndHorizontal();

        //  update the marker with new values
        EditorGUILayout.Space();
        if (GUILayout.Button("Update"))
        {
            RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius, adaptToTileHeight, tilesMask);
        }
    }
Esempio n. 3
0
    public static void UpdateMarker(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius)
    {
        List <GameObject> remove = new List <GameObject>();

        foreach (Transform t in marker.transform)
        {
            remove.Add(t.gameObject);
        }
        remove.ForEach(go => DestroyImmediate(go));

        if (markerFab == null)
        {
            return;
        }
        if (markerRadius < 1)
        {
            markerRadius = 1;
        }
        marker.prefab        = markerFab;
        marker.markerLayout  = markerLayout;
        marker.markerSpacing = markerSpacing;
        marker.markerSize    = markerSize;
        marker.markerRadius  = markerRadius;
        CreateMarkerNodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
    }
Esempio n. 4
0
    // ====================================================================================================================
    #region create tools

    public static void UpdateMarker(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius, bool adaptToTileHeight, int tileMask)
    {
        // delete old marker nodes
        List <GameObject> remove = new List <GameObject>();

        foreach (Transform t in marker.transform)
        {
            remove.Add(t.gameObject);
        }
        remove.ForEach(go => DestroyImmediate(go));

        if (markerFab == null)
        {
            return;
        }
        if (markerRadius < 1)
        {
            markerRadius = 1;
        }
        marker.prefab            = markerFab;
        marker.markerLayout      = markerLayout;
        marker.markerSpacing     = markerSpacing;
        marker.markerSize        = markerSize;
        marker.markerRadius      = markerRadius;
        marker.adaptToTileHeight = adaptToTileHeight;
        marker.tilesMask         = tileMask;

        // and create new ones
        CreateMarkerNodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
    }
Esempio n. 5
0
    void OnEnable()
    {
        RadiusMarker marker = (target as RadiusMarker);

        markerLayout  = marker.markerLayout;
        markerSpacing = marker.markerSpacing;
        markerSize    = marker.markerSize;
        markerRadius  = marker.markerRadius;
        markerFab     = marker.prefab;
    }
Esempio n. 6
0
    void OnEnable()
    {
        RadiusMarker marker = (target as RadiusMarker);

        markerLayout      = marker.markerLayout;
        markerSpacing     = marker.markerSpacing;
        markerSize        = marker.markerSize;
        markerRadius      = marker.markerRadius;
        markerFab         = marker.prefab;
        adaptToTileHeight = marker.adaptToTileHeight;
        tilesMask         = marker.tilesMask;
    }
Esempio n. 7
0
 private static void CreateMarkerNodes(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius)
 {
     if (markerLayout == MapNav.TilesLayout.Hex)
     {
         CreateHexNodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
     }
     else if (markerLayout == MapNav.TilesLayout.Square_4)
     {
         CreateSquar4Nodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
     }
     else if (markerLayout == MapNav.TilesLayout.Square_8)
     {
         CreateSquar8Nodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
     }
 }
Esempio n. 8
0
    void OnGUI()
    {
        EditorGUILayout.Space();
        GUILayout.Label("Choosing values similar to your MapNav\ntile values will work best here", EditorStyles.label);
        EditorGUILayout.Space();
        markerFab     = (GameObject)EditorGUILayout.ObjectField("Marker Node Prefab", markerFab, typeof(GameObject), false);
        markerLayout  = EditorGUILayout.Popup("Marker Layout", markerLayout, MapNavEditor.TilesLayoutStrings);
        markerSpacing = EditorGUILayout.FloatField("Marker Node Spacing", markerSpacing);
        markerSize    = EditorGUILayout.FloatField("Marker Node Size", markerSize);
        markerRadius  = EditorGUILayout.IntField("Marker Radius", markerRadius);

        EditorGUILayout.Space();
        if (GUILayout.Button("Create Marker"))
        {
            RadiusMarker.CreateMarker(markerFab, (MapNav.TilesLayout)markerLayout, markerSpacing, markerSize, markerRadius);
            Close();
        }
    }
Esempio n. 9
0
    public static void CreateMarker(GameObject markerFab, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius)
    {
        if (markerFab == null)
        {
            return;
        }
        if (markerRadius < 1)
        {
            markerRadius = 1;
        }
        GameObject go = new GameObject();

        go.name = "Marker";
        RadiusMarker marker = go.AddComponent <RadiusMarker>();

        marker.prefab        = markerFab;
        marker.markerLayout  = markerLayout;
        marker.markerSpacing = markerSpacing;
        marker.markerSize    = markerSize;
        marker.markerRadius  = markerRadius;
        CreateMarkerNodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
    }
Esempio n. 10
0
	private static void CreateSquar8Nodes(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius)
	{
		GameObject go;

		marker.markerNodes = new GameObject[markerRadius];

		for (int i = 0; i < markerRadius; i++)
		{
			GameObject parent = new GameObject();
			parent.name = (i < 10 ? "0" : "") + i.ToString();
			parent.transform.position = marker.transform.position + new Vector3(0f, 0.1f, 0f);
			parent.transform.parent = marker.transform;
			marker.markerNodes[i] = parent;

			// up
			go = (GameObject)GameObject.Instantiate(markerFab);
			go.transform.parent = parent.transform;
			go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
			go.transform.localPosition = new Vector3(0f, 0f, markerSpacing * (i + 1));
			for (int j = 0; j < i + 1; j++)
			{	// to right
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3(markerSpacing * (j + 1), 0f, markerSpacing * (i + 1));
				// to left
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3(-markerSpacing * (j + 1), 0f, markerSpacing * (i + 1));
			}

			// down
			go = (GameObject)GameObject.Instantiate(markerFab);
			go.transform.parent = parent.transform;
			go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
			go.transform.localPosition = new Vector3(0f, 0f, -markerSpacing * (i + 1));
			for (int j = 0; j < i + 1; j++)
			{	// to right
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3(markerSpacing * (j + 1), 0f, -markerSpacing * (i + 1));
				// to left
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3(-markerSpacing * (j + 1), 0f, -markerSpacing * (i + 1));
			}

			// right
			go = (GameObject)GameObject.Instantiate(markerFab);
			go.transform.parent = parent.transform;
			go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
			go.transform.localPosition = new Vector3(+markerSpacing * (i + 1), 0f, 0f);
			for (int j = 0; j < i; j++)
			{	// up
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3(markerSpacing * (i + 1), 0f, markerSpacing * (j + 1));
				// down
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3(markerSpacing * (i + 1), 0f, -markerSpacing * (j + 1));
			}

			// left
			go = (GameObject)GameObject.Instantiate(markerFab);
			go.transform.parent = parent.transform;
			go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
			go.transform.localPosition = new Vector3(-markerSpacing * (i + 1), 0f, 0f);
			for (int j = 0; j < i; j++)
			{	// up
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3(-markerSpacing * (i + 1), 0f, markerSpacing * (j + 1));
				// down
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3(-markerSpacing * (i + 1), 0f, -markerSpacing * (j + 1));
			}
		}
	}
Esempio n. 11
0
	private static void CreateHexNodes(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius)
	{
		GameObject go;
		marker.markerNodes = new GameObject[markerRadius];

		float xOffs = markerSpacing * 0.50f * Mathf.Sqrt(3f);
		float yOffs = markerSpacing * 0.75f;
		float offs = xOffs * 0.5f;

		for (int i = 0; i < markerRadius; i++)
		{
			GameObject parent = new GameObject();
			parent.name = (i < 10 ? "0" : "") + i.ToString();
			parent.transform.position = marker.transform.position + new Vector3(0f, 0.1f, 0f);
			parent.transform.parent = marker.transform;
			marker.markerNodes[i] = parent;

			// right
			go = (GameObject)GameObject.Instantiate(markerFab);
			go.transform.parent = parent.transform;
			go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
			go.transform.localPosition = new Vector3(xOffs * (i + 1), 0f, 0f);
			for (int j = 0; j < i + 1; j++)
			{
				// up
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3((xOffs * (i + 1)) - (offs * (j + 1)), 0f, yOffs * (j + 1));
				// down
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3((xOffs * (i + 1)) - (offs * (j + 1)), 0f, -yOffs * (j + 1));
			}

			// left
			go = (GameObject)GameObject.Instantiate(markerFab);
			go.transform.parent = parent.transform;
			go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
			go.transform.localPosition = new Vector3(-xOffs * (i + 1), 0f, 0f);
			for (int j = 0; j < i + 1; j++)
			{
				// up
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3((-xOffs * (i + 1)) + (offs * (j + 1)), 0f, yOffs * (j + 1));
				// down
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3((-xOffs * (i + 1)) + (offs * (j + 1)), 0f, -yOffs * (j + 1));
			}

			// up
			for (int j = 0; j < i; j++)
			{
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3((xOffs * j) - (offs * (i - 1)), 0f, yOffs * (i + 1));
			}

			// down
			for (int j = 0; j < i; j++)
			{
				go = (GameObject)GameObject.Instantiate(markerFab);
				go.transform.parent = parent.transform;
				go.transform.localScale = new Vector3(markerSize, markerSize, markerSize);
				go.transform.localPosition = new Vector3((xOffs * j) - (offs * (i - 1)), 0f, -yOffs * (i + 1));
			}
		}
	}
Esempio n. 12
0
	private static void CreateMarkerNodes(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius)
	{
		if (markerLayout == MapNav.TilesLayout.Hex) CreateHexNodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
		else if (markerLayout == MapNav.TilesLayout.Square_4) CreateSquar4Nodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
		else if (markerLayout == MapNav.TilesLayout.Square_8) CreateSquar8Nodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
	}
Esempio n. 13
0
	// ====================================================================================================================
	#region create tools

	public static void UpdateMarker(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius, bool adaptToTileHeight, int tileMask)
	{
		// delete old marker nodes
		List<GameObject> remove = new List<GameObject>();
		foreach (Transform t in marker.transform) remove.Add(t.gameObject);
		remove.ForEach(go => DestroyImmediate(go));

		if (markerFab == null) return;
		if (markerRadius < 1) markerRadius = 1;
		marker.prefab = markerFab;
		marker.markerLayout = markerLayout;
		marker.markerSpacing = markerSpacing;
		marker.markerSize = markerSize;
		marker.markerRadius = markerRadius;
		marker.adaptToTileHeight = adaptToTileHeight;
		marker.tilesMask = tileMask;

		// and create new ones
		CreateMarkerNodes(markerFab, marker, markerLayout, markerSpacing, markerSize, markerRadius);
	}
Esempio n. 14
0
    private static void CreateSquar8Nodes(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius)
    {
        GameObject go;

        marker.markerNodes = new GameObject[markerRadius];

        for (int i = 0; i < markerRadius; i++)
        {
            GameObject parent = new GameObject();
            parent.name = (i < 10 ? "0" : "") + i.ToString();
            parent.transform.position = marker.transform.position + new Vector3(0f, 0.1f, 0f);
            parent.transform.parent   = marker.transform;
            marker.markerNodes[i]     = parent;

            // up
            go = (GameObject)GameObject.Instantiate(markerFab);
            go.transform.parent        = parent.transform;
            go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
            go.transform.localPosition = new Vector3(0f, 0f, markerSpacing * (i + 1));
            for (int j = 0; j < i + 1; j++)
            {                   // to right
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3(markerSpacing * (j + 1), 0f, markerSpacing * (i + 1));
                // to left
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3(-markerSpacing * (j + 1), 0f, markerSpacing * (i + 1));
            }

            // down
            go = (GameObject)GameObject.Instantiate(markerFab);
            go.transform.parent        = parent.transform;
            go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
            go.transform.localPosition = new Vector3(0f, 0f, -markerSpacing * (i + 1));
            for (int j = 0; j < i + 1; j++)
            {                   // to right
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3(markerSpacing * (j + 1), 0f, -markerSpacing * (i + 1));
                // to left
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3(-markerSpacing * (j + 1), 0f, -markerSpacing * (i + 1));
            }

            // right
            go = (GameObject)GameObject.Instantiate(markerFab);
            go.transform.parent        = parent.transform;
            go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
            go.transform.localPosition = new Vector3(+markerSpacing * (i + 1), 0f, 0f);
            for (int j = 0; j < i; j++)
            {                   // up
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3(markerSpacing * (i + 1), 0f, markerSpacing * (j + 1));
                // down
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3(markerSpacing * (i + 1), 0f, -markerSpacing * (j + 1));
            }

            // left
            go = (GameObject)GameObject.Instantiate(markerFab);
            go.transform.parent        = parent.transform;
            go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
            go.transform.localPosition = new Vector3(-markerSpacing * (i + 1), 0f, 0f);
            for (int j = 0; j < i; j++)
            {                   // up
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3(-markerSpacing * (i + 1), 0f, markerSpacing * (j + 1));
                // down
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3(-markerSpacing * (i + 1), 0f, -markerSpacing * (j + 1));
            }
        }
    }
Esempio n. 15
0
 private static void CreateHexNodes(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius)
 {
     // ÔÝδʵÏÖ
 }
Esempio n. 16
0
    private static void CreateHexNodes(GameObject markerFab, RadiusMarker marker, MapNav.TilesLayout markerLayout, float markerSpacing, float markerSize, int markerRadius)
    {
        GameObject go;

        marker.markerNodes = new GameObject[markerRadius];

        float xOffs = markerSpacing * 0.50f * Mathf.Sqrt(3f);
        float yOffs = markerSpacing * 0.75f;
        float offs  = xOffs * 0.5f;

        for (int i = 0; i < markerRadius; i++)
        {
            GameObject parent = new GameObject();
            parent.name = (i < 10 ? "0" : "") + i.ToString();
            parent.transform.position = marker.transform.position + new Vector3(0f, 0.1f, 0f);
            parent.transform.parent   = marker.transform;
            marker.markerNodes[i]     = parent;

            // right
            go = (GameObject)GameObject.Instantiate(markerFab);
            go.transform.parent        = parent.transform;
            go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
            go.transform.localPosition = new Vector3(xOffs * (i + 1), 0f, 0f);
            for (int j = 0; j < i + 1; j++)
            {
                // up
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3((xOffs * (i + 1)) - (offs * (j + 1)), 0f, yOffs * (j + 1));
                // down
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3((xOffs * (i + 1)) - (offs * (j + 1)), 0f, -yOffs * (j + 1));
            }

            // left
            go = (GameObject)GameObject.Instantiate(markerFab);
            go.transform.parent        = parent.transform;
            go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
            go.transform.localPosition = new Vector3(-xOffs * (i + 1), 0f, 0f);
            for (int j = 0; j < i + 1; j++)
            {
                // up
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3((-xOffs * (i + 1)) + (offs * (j + 1)), 0f, yOffs * (j + 1));
                // down
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3((-xOffs * (i + 1)) + (offs * (j + 1)), 0f, -yOffs * (j + 1));
            }

            // up
            for (int j = 0; j < i; j++)
            {
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3((xOffs * j) - (offs * (i - 1)), 0f, yOffs * (i + 1));
            }

            // down
            for (int j = 0; j < i; j++)
            {
                go = (GameObject)GameObject.Instantiate(markerFab);
                go.transform.parent        = parent.transform;
                go.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                go.transform.localPosition = new Vector3((xOffs * j) - (offs * (i - 1)), 0f, -yOffs * (i + 1));
            }
        }
    }