This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// NOTE: this struct is assumed to be column ordered, i.e. compatable with even-q and odd-q offset coordinate layouts | |
public struct OffsetCoordinate | |
{ | |
public int col { get { return _col; } } | |
public int row { get { return _row; } } | |
int _col; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEditor; | |
[CustomEditor(typeof(MyHexagon))] | |
public class MyHexagonInspector : Editor | |
{ | |
public override void OnInspectorGUI() | |
{ | |
var myHex = (MyHexagon)target; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class MyHexagon : Hexagon | |
{ | |
public void Start() | |
{ | |
SetColor(Color.white); | |
SetOutlineColor(Color.black); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
using System; | |
// for now, let's simplify our possible representations to match the core examples | |
// in the link below; full set of layout options is: odd_r, even_r, odd_q, even_q | |
public enum HexGridType { odd_q } | |
// implementation of hexagonal cell | |
// helpful link: http://www.redblobgames.com/grids/hexagons/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Networking; | |
using System; | |
using System.Collections.Generic; | |
public abstract class Cell : NetworkBehaviour, IGraphNode, ITouchable | |
{ | |
public OffsetCoordinate offsetCoord | |
{ | |
get { return _offsetCoord; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEngine.Assertions; | |
public enum CoordinateType { Off, Cube, Offset, Index } // NOTE: offset coordinates are type 'even-q' | |
public class HexCellUI : MonoBehaviour | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEditor; | |
[CustomEditor(typeof(Battle))] | |
public class BattleInspector : Editor | |
{ | |
public override void OnInspectorGUI() | |
{ | |
var battle = (Battle)target; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Networking; | |
using UnityEngine.SceneManagement; | |
using UnityEngine.Assertions; | |
using System.Collections; | |
public class LocalHostBootstrap : MonoBehaviour | |
{ | |
string _debugString; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.IO; | |
using UnityEngine.Assertions; | |
using UnityEditor; | |
[InitializeOnLoad] | |
class EditorStartup | |
{ |