コード例 #1
0
ファイル: Hexagon.cs プロジェクト: richie315066406/myWorld
        protected override void OnShow(object userData)
        {
            base.OnShow(userData);
            m_HexagonData = (HexagonData)userData;

//			m_HexagonData.OffsetCoord = new Vector2(Width - j - 1, Height - i - 1);
//			m_HexagonData.OffsetCoord = hexGridType;
            m_HexagonData.MovementCost = 1;
        }
コード例 #2
0
        private static void RectangularHexGridGenerator(this EntityComponent entityComponent, HexagonData data, int height, int width)
        {
            HexGridType hexGridType = width % 2 == 0 ? HexGridType.even_q : HexGridType.odd_q;

            for (int i = 0; i < height; i++)
            {
                for (int j = 0; j < width; j++)
                {
                    data.Position = new Vector3(i, j);
                    entityComponent.ShowEntity(typeof(Hexagon), "Cell", Constant.AssetPriority.AircraftAsset, data);
                }
            }
            Log.Info("RectangularHexGridGenerator");
        }