Commit 602a0ea8 authored by 15조준엽's avatar 15조준엽

initial commit

parent 66ffeb73
This diff is collapsed.
fileFormatVersion: 2
guid: ef12b8f6d512e104b979d4a75f3e60c0
timeCreated: 1518406688
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
......
This diff is collapsed.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CivModel;
public class GameManager : MonoBehaviour
{
private CivModel.Game _game;
public CivModel.Game Game { get { return _game; } }
public float outerRadius = 1f; // Outer&inner radius of hex tile.
public float innerRadius = Mathf.Sqrt(3) / 2; // These variables can be deleted if there are no use.
public GameObject HextilePrefab;
private GameObject[,] _tiles;
public GameObject[,] Tiles { get { return _tiles; } }
void Awake()
{
var factories = new IGameSchemeFactory[]
{
new CivModel.Common.GameSchemeFactory(),
new CivModel.Hwan.GameSchemeFactory(),
new CivModel.Finno.GameSchemeFactory(),
new CivModel.Quests.GameSchemeFactory(),
new CivModel.Zap.GameSchemeFactory(),
new CivModel.AI.GameSchemeFactory()
};
_game = new CivModel.Game(".\\Assets\\map.txt", factories);
_game.StartTurn();
}
// Use this for initialization
void Start ()
{
InitiateMap();
}
// Update is called once per frame
void Update () {
}
private void InitiateMap()
{
_tiles = new GameObject[_game.Terrain.Width, _game.Terrain.Height];
for (int i = 0; i < _game.Terrain.Width; i++)
{
for (int j = 0; j < _game.Terrain.Height; j++)
{
Vector3 pos = new Vector3(2 * i * innerRadius, -0.05f, -j * outerRadius * 1.5f);
if (j % 2 != 0)
{
pos.x -= innerRadius;
}
_tiles[i, j] = Instantiate(HextilePrefab, pos, Quaternion.identity);
_tiles[i, j].name = String.Format("({0},{1})", i, j);
_tiles[i, j].GetComponent<HexTile>().point = _game.Terrain.GetPoint(i, j);
/*
* TODO
* hextile을 생성한 후, Terrian point 클래스의 값을 이용하여
* Hextile의 terrains, tilebuilding을 수정해야 함.
*/
}
}
}
}
fileFormatVersion: 2
guid: 6bd8a49bccaadfc4c95d2ffc7cea604c
folderAsset: yes
DefaultImporter:
guid: 21eefa2ef0518bc4891057f3f8916cb5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -2,20 +2,23 @@
using System.Collections.Generic;
using UnityEngine;
public class HexTile : MonoBehaviour
{
// 현재 tile의 위치의 point class
public CivModel.Terrain.Point point;
void Start ()
{
}
void Update()
{
// prefab의 자식 gameobject들
GameObject terrains;
GameObject tilebuildings;
}
/*
* TODO
* Hextile Prefab을 수정하여 terrain와 tilebuilding을 설정할 수 있게 해야함.
*/
/*
* 관련 legacy code
public void ChangeTile()
{
if (terrains == null)
......@@ -54,5 +57,5 @@ public class HexTile : MonoBehaviour
{
TileBuildingObject(building);
}
}
}*/
}
......@@ -664,9 +664,9 @@ PlayerSettings:
UNet: 1
facebookSdkVersion: 7.9.4
apiCompatibilityLevel: 3
cloudProjectId: 3c4449d6-16ad-47f1-9c24-c6b481667cdd
projectName: civilization-iii
organizationId: dshseungwon
cloudProjectId: 351bd782-e721-4672-a71a-85649ff2d005
projectName: civilization-iii (1)
organizationId: abslon
cloudEnabled: 0
enableNativePlatformBackendsForNewInputSystem: 0
disableOldInputManagerSupport: 0
......@@ -28,7 +28,9 @@ UnityConnectSettings:
m_TestMode: 0
m_IosGameId:
m_AndroidGameId:
m_GameIds: {}
m_GameIds:
AndroidPlayer:
iPhonePlayer:
m_GameId:
PerformanceReportingSettings:
m_Enabled: 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment