Commit 3d192b8c authored by redsuncore's avatar redsuncore

MapUI some Values connecting, SelectionQueue devided, applied new model. (WIP)

모델 업데이트
맵 UI 에 현재 플레이어의 인구 기술력 제외 연결
공격 기능 업데이트. (제다이 기사 확인하지 못해서 아직 디버그 못함)
선택 큐 분리됨. 모델에서 얻어오는 기능을 다시 한 번 찾아봐야 함(WIP)
parent 65da7f1f
fileFormatVersion: 2
guid: 14316eefeff7b8c4882dee9cb31df5f1
timeCreated: 1518214576
timeCreated: 1519390593
licenseType: Free
DefaultImporter:
externalObjects: {}
......
fileFormatVersion: 2
guid: 51a4ccfc53e3bd3489fedcd4adb9e458
timeCreated: 1518214576
timeCreated: 1519390593
licenseType: Free
DefaultImporter:
externalObjects: {}
......
This diff is collapsed.
......@@ -20,7 +20,7 @@ GameObject:
m_Component:
- component: {fileID: 4436999106154904}
m_Layer: 0
m_Name: Unit
m_Name: Building
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -204,6 +204,21 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &1906341680304698
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4310160372248550}
m_Layer: 0
m_Name: Unit
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1938409798695032
GameObject:
m_ObjectHideFlags: 1
......@@ -250,7 +265,7 @@ Transform:
m_LocalPosition: {x: 0, y: 0.4, z: 0}
m_LocalScale: {x: 0.5, y: 0.8, z: 0.5}
m_Children: []
m_Father: {fileID: 4436999106154904}
m_Father: {fileID: 4310160372248550}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4157427397233106
......@@ -276,7 +291,7 @@ Transform:
m_LocalPosition: {x: 0, y: 0.4, z: 0}
m_LocalScale: {x: 0.5, y: 0.8, z: 0.5}
m_Children: []
m_Father: {fileID: 4436999106154904}
m_Father: {fileID: 4310160372248550}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4297799600058746
......@@ -300,6 +315,21 @@ Transform:
m_Father: {fileID: 4624084589808502}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4310160372248550
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1906341680304698}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4245987888127746}
- {fileID: 4094104317531802}
m_Father: {fileID: 4624084589808502}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4312907416615170
Transform:
m_ObjectHideFlags: 1
......@@ -319,14 +349,12 @@ Transform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000109618337908}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4245987888127746}
- {fileID: 4094104317531802}
m_Children: []
m_Father: {fileID: 4624084589808502}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4567653727305688
Transform:
......@@ -348,10 +376,11 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1823159130722898}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 19.01729, y: 122.487495, z: -380.40945}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4297799600058746}
- {fileID: 4310160372248550}
- {fileID: 4436999106154904}
m_Father: {fileID: 0}
m_RootOrder: 0
......
fileFormatVersion: 2
guid: ae6f6d3cef6797e41a4a0577aeca03c7
folderAsset: yes
timeCreated: 1519407690
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: city_buildings_texture
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 9a1f22ecdcf493c44b3fd5a542f95e4a, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: 15b7a205fe87c4149a45db5b7613f512
timeCreated: 1519407690
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
......@@ -11853,6 +11853,17 @@ MonoBehaviour:
MapUI: {fileID: 531803464}
ManagementUI: {fileID: 687281509}
QuestUI: {fileID: 1243551243}
Gold: {fileID: 520572089}
Population: {fileID: 1776750191}
Happiness: {fileID: 79311831}
Technology: {fileID: 1494908599}
Labor: {fileID: 798699953}
UnitInfo: {fileID: 1452676922}
UnitName: {fileID: 83997300}
UnitAttack: {fileID: 964404866}
UnitDefence: {fileID: 1481027123}
UnitEffect: {fileID: 896622680}
ActionPoint: {fileID: 1830873737}
SpecialSpec: {fileID: 269591156}
SkillSet: {fileID: 1558743809}
UnitSelTab: {fileID: 309872625}
......@@ -11893,7 +11904,13 @@ MonoBehaviour:
type: 2}
proQueue: {fileID: 1681201286}
depQueue: {fileID: 1623971497}
productableQueue: {fileID: 1447270533}
EpicQueue: {fileID: 1447270533}
HighQueue: {fileID: 1911486372}
IntermediateQueue: {fileID: 410991340}
LowQueue: {fileID: 822141376}
CityQueue: {fileID: 1340925456}
CityBuildingQueue: {fileID: 1289093026}
NormalBuildingQueue: {fileID: 436280704}
--- !u!1001 &1060029827
Prefab:
m_ObjectHideFlags: 0
......@@ -20347,7 +20364,7 @@ GameObject:
- component: {fileID: 1830873738}
- component: {fileID: 1830873737}
m_Layer: 5
m_Name: Text
m_Name: ActionPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -20369,7 +20386,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: -0.000061035156, y: 0}
m_SizeDelta: {x: 40, y: 40}
m_SizeDelta: {x: 70, y: 40}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1830873737
MonoBehaviour:
......
......@@ -57,7 +57,7 @@ public class GameManager : MonoBehaviour {
}
// Use this when scene changing exists
// DontDestroyOnLoad(gameObject);
_game = new CivModel.Game(GameInfo.mapWidth, GameInfo.mapHeight, GameInfo.numOfPlayer, new CivModel.Common.GameSchemeFactory());
_game = new CivModel.Game(GameInfo.mapWidth, GameInfo.mapHeight, GameInfo.numOfPlayer);
_game.StartTurn();
}
......@@ -105,6 +105,20 @@ public class GameManager : MonoBehaviour {
else
PseudoFSM.I.NormalStateEnter();
}
if (PseudoFSM.I.AttackState)
{
if (tile.isFlickering)
{
if (tile.point.TileBuilding != null)
SelectedActor.AttackTo(tile.point.TileBuilding);
else if (tile.point.Unit != null)
SelectedActor.AttackTo(tile.point.Unit);
else
Debug.Log("잘못된 공격 대상");
}
else
PseudoFSM.I.NormalStateEnter();
}
Unit unit = tile.point.Unit;
if (unit != null)
{
......@@ -156,6 +170,10 @@ public class GameManager : MonoBehaviour {
}
}
public void BuildBuilding(CivModel.Terrain.Point pos, TileBuilding building)
{
}
// Read game terrain and update hex tile resource
void Render(CivModel.Terrain terrain)
{
......@@ -313,4 +331,23 @@ public static class ProductionFactoryTraits
}
return result;
}
public static string GetName(CivModel.Unit unit)
{
char[] sep = { '.' };
string name = unit.ToString().Split(sep)[2];
string result;
switch (name)
{
case "Pioneer":
result = "개척자";
break;
case "JediKnight":
result = "제다이 기사";
break;
default:
result = "unknown : " + name;
break;
}
return result;
}
}
\ No newline at end of file
......@@ -21,7 +21,8 @@ public class ManagementUIController : MonoBehaviour {
private List<GameObject> PQlist;
private List<GameObject> DQlist;
private List<GameObject> SQlist;
private List<GameObject> EpicQlist, HighQlist, IntermediateQlist, LowQlist; // Unit production
private List<GameObject> CityQlist, CityBuildingQlist, NormalBuildingQlist;
public GameObject proPrefab;
public GameObject depPrefab;
......@@ -29,9 +30,11 @@ public class ManagementUIController : MonoBehaviour {
public GameObject proQueue;
public GameObject depQueue;
public GameObject productableQueue;
public GameObject EpicQueue, HighQueue, IntermediateQueue, LowQueue; // Unit production
public GameObject CityQueue, CityBuildingQueue, NormalBuildingQueue; // Building production
public void ManageFunction() // Management tab on/off button -> ManageMentUIActive
private List<GameObject> MakeSelectionQ(List<GameObject> SQlist, GameObject productableQueue)
{
List<GameObject> tempList = new List<GameObject>();
Debug.Log("SelectList startMaking");
......@@ -41,6 +44,7 @@ public class ManagementUIController : MonoBehaviour {
}
SQlist.Clear();
facList = game.PlayerInTurn.GetAvailableProduction();
//facList의 변경으로 Epic-High-intermediate-Low 변경 가능. 하지만 지금은 설정되지 않았음(Epic에 생성)
Debug.Log(facList + " " + facList.Count);
Debug.Log("facList : " + facList.Count);
Debug.Log("SelectList Updated");
......@@ -62,13 +66,17 @@ public class ManagementUIController : MonoBehaviour {
SPrefab.GetComponent<SelPrefab>().MakeItem();
tempList.Add(SPrefab);
}
SQlist = tempList;
return tempList;
}
public void ManageFunction() // Management tab on/off button -> ManageMentUIActive
{
EpicQlist = MakeSelectionQ(EpicQlist, EpicQueue);
MakeProductionQ();
MakeDeploymentQ();
foreach (GameObject sq in SQlist)
foreach (GameObject sq in EpicQlist)
{
sq.GetComponent<SelPrefab>().SetButton(SQlist.IndexOf(sq));
Debug.Log(SQlist.IndexOf(sq));
sq.GetComponent<SelPrefab>().SetButton(EpicQlist.IndexOf(sq));
Debug.Log(EpicQlist.IndexOf(sq));
}
foreach (GameObject dq in DQlist)
{
......@@ -94,7 +102,15 @@ public class ManagementUIController : MonoBehaviour {
{
gameManager = GameManager.I;
game = gameManager.Game;
SQlist = new List<GameObject>();
EpicQlist = new List<GameObject>();
HighQlist = new List<GameObject>();
IntermediateQlist = new List<GameObject>();
LowQlist = new List<GameObject>();
CityQlist = new List<GameObject>();
CityBuildingQlist = new List<GameObject>();
NormalBuildingQlist = new List<GameObject>();
PQlist = new List<GameObject>();
DQlist = new List<GameObject>();
}
......
......@@ -176,8 +176,7 @@ public class PseudoFSM : MonoBehaviour {
int index = _currentSkill;
_inSkillState = false;
_currentSkill = -1;
if (!GameManager.I.SelectedActor.SpecialActs[index].IsParametered)
if (GameManager.I.SelectedActor == null || !GameManager.I.SelectedActor.SpecialActs[index].IsParametered)
{
return;
}
......
......@@ -10,6 +10,19 @@ public class UIManager : MonoBehaviour {
public GameObject ManagementUI;
public GameObject QuestUI;
public Text Gold;
public Text Population;
public Text Happiness;
public Text Technology;
public Text Labor;
public GameObject UnitInfo;
public Text UnitName;
public Text UnitAttack;
public Text UnitDefence;
public Text UnitEffect;
public Text ActionPoint;
public GameObject SpecialSpec;
/*
public GameObject SkillSpec1;
......@@ -48,17 +61,44 @@ public class UIManager : MonoBehaviour {
}
void Start()
{
uicontroller = ManagementUIController.GetManagementUIController();
uicontroller = ManagementUIController.GetManagementUIController();
}
void Update()
{
if (GameManager.I.isThereTodos)
{
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "유닛이 명령을 기다리고 있습니다";
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 40;
}
else
{
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "다음 턴";
MapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 25;
}
Gold.text = "금 : " + GameManager.I.Game.PlayerInTurn.Gold + "(+" + GameManager.I.Game.PlayerInTurn.GoldIncome + ")";
Population.text = "인구 : "; // Model 업데이트 이후 어디서 찾아야 하는지 찾을 필요성 있음.
Happiness.text = "행복 : " + GameManager.I.Game.PlayerInTurn.Happiness;
Technology.text = "기술력 : "; // Model 업데이트 이후 어디서 찾아야 하는지 찾을 필요성 있음.
Labor.text = "노동력 : " + GameManager.I.Game.PlayerInTurn.Labor;
if(GameManager.I.SelectedActor != null)
{
UnitInfo.SetActive(true);
UnitName.text = ProductionFactoryTraits.GetName(GameManager.I.SelectedActor);
UnitAttack.text = GameManager.I.SelectedActor.AttackPower.ToString();
UnitDefence.text = GameManager.I.SelectedActor.DefencePower.ToString();
UnitEffect.text = "";
ActionPoint.text = GameManager.I.SelectedActor.RemainAP + "/" + GameManager.I.SelectedActor.MaxAP;
}
else
{
UnitInfo.SetActive(false);
UnitName.text = "";
UnitAttack.text = "";
UnitDefence.text = "";
UnitEffect.text = "";
ActionPoint.text = "";
}
}
......
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