Commit 55310787 authored by redsuncore's avatar redsuncore

Apply Deployment Queue, Production Queue

생산, 배치 큐 재작동
GameManager 싱글톤 적용 시점 Awake로 변경
Unit, City합해서 7가지 Factory Queue 만들어줄 것(배치 Queue 적용)
parent c1f88acd
......@@ -72,7 +72,7 @@ GameObject:
- component: {fileID: 224370154200431468}
- component: {fileID: 222753816676270096}
- component: {fileID: 114644775417974404}
- component: {fileID: 114964981432633434}
- component: {fileID: 114259291661999178}
m_Layer: 5
m_Name: Deployment
m_TagString: Untagged
......@@ -148,6 +148,17 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: '>>'
--- !u!114 &114259291661999178
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1800725053202814}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9642702daf79c1240b7c6a4c15881e8a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114319455215444200
MonoBehaviour:
m_ObjectHideFlags: 1
......@@ -336,17 +347,6 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Hwan Jedi Knights
--- !u!114 &114964981432633434
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1800725053202814}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bdf0fa739872652438abde0f4b5f6f2a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!222 &222307349340161390
CanvasRenderer:
m_ObjectHideFlags: 1
......
......@@ -21,7 +21,7 @@ GameObject:
- component: {fileID: 224986414258216942}
- component: {fileID: 222135170727484646}
- component: {fileID: 114714445060941948}
- component: {fileID: 114164965800359672}
- component: {fileID: 114972554173301058}
m_Layer: 5
m_Name: Prodcution
m_TagString: Untagged
......@@ -373,17 +373,6 @@ MonoBehaviour:
m_Calls: []
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114164965800359672
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1096080870604826}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bdf0fa739872652438abde0f4b5f6f2a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114278032587565768
MonoBehaviour:
m_ObjectHideFlags: 1
......@@ -941,6 +930,17 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: X
--- !u!114 &114972554173301058
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1096080870604826}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 617a8b6afcceae548bd2185fc96067cf, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!222 &222135170727484646
CanvasRenderer:
m_ObjectHideFlags: 1
......@@ -1038,7 +1038,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1456819948185784}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 180, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.0000085, y: 1.0000085, z: 1.0000085}
m_Children:
- {fileID: 224063358361659782}
......@@ -1057,7 +1057,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1645106360731540}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 240, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224788492354638598}
......@@ -1076,7 +1076,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1884306789771022}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 13, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224037507103280948}
......@@ -1094,7 +1094,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1781506280375324}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 15, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224986414258216942}
......@@ -1112,7 +1112,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1421157283910740}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 210, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224376503176827196}
......@@ -1131,7 +1131,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1601512692181824}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 13, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224280958653453782}
......@@ -1149,7 +1149,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1338392406114718}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 270, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224852679972572050}
......@@ -1168,7 +1168,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1433014461670408}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 875, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224897286653650632}
......@@ -1187,7 +1187,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1343654971755260}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 390, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224986414258216942}
......@@ -1205,7 +1205,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1510495277354180}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 13, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224055411862134792}
......@@ -1223,7 +1223,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1874316765571096}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 13, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224389951776311984}
......@@ -1241,7 +1241,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1646826808927886}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 675, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224986414258216942}
......@@ -1259,7 +1259,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1688449095768534}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -32.5, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224569045783380188}
......@@ -1277,7 +1277,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1177144607166594}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 480, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224986414258216942}
......@@ -1310,8 +1310,8 @@ RectTransform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 890, y: 90}
m_Pivot: {x: 0, y: 1}
......@@ -563,8 +563,8 @@ RectTransform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 580, y: 90}
m_Pivot: {x: 0, y: 1}
......
......@@ -107,7 +107,7 @@ GameObject:
- component: {fileID: 224299890530524656}
- component: {fileID: 222113836344079132}
- component: {fileID: 114697144497747568}
- component: {fileID: 114267073886964138}
- component: {fileID: 114810348894158920}
m_Layer: 5
m_Name: UnitToProduce
m_TagString: Untagged
......@@ -272,17 +272,6 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\uFE40"
--- !u!114 &114267073886964138
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1602855710582796}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bdf0fa739872652438abde0f4b5f6f2a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114305620023846986
MonoBehaviour:
m_ObjectHideFlags: 1
......@@ -315,7 +304,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Hwan Jedi Knights
m_Text: Jackie Chan
--- !u!114 &114483254682674324
MonoBehaviour:
m_ObjectHideFlags: 1
......@@ -592,6 +581,17 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\uFE3F"
--- !u!114 &114810348894158920
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1602855710582796}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 668b75e98a9b4fb42b9ba5f3cb35c87b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114863655732304418
MonoBehaviour:
m_ObjectHideFlags: 1
......@@ -686,7 +686,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1768164423952344}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 580, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224915366493292808}
......@@ -705,7 +705,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1941584303812400}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 625, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224297350033195720}
......@@ -724,7 +724,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1424478513462088}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -20, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224102761718121762}
......@@ -742,7 +742,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1602855710582796}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -12.0000305, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224411969505313536}
......@@ -754,9 +754,9 @@ RectTransform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: -12.0000305, y: -0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 640, y: 90}
m_Pivot: {x: 0, y: 1}
--- !u!224 &224411969505313536
......@@ -766,7 +766,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1352272583548454}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 15, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224428265050314132}
......@@ -785,7 +785,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1677723935185548}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 175, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224299890530524656}
......@@ -803,7 +803,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1216167039061454}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 32.5, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224411969505313536}
......@@ -821,7 +821,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1208714839199910}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 95, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224299890530524656}
......@@ -839,7 +839,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1613993639300952}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 520, y: -45, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224299890530524656}
......@@ -857,7 +857,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1573887469170292}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -20, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224020156847673032}
......
This diff is collapsed.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using CivPresenter;
using CivModel;
using CivModel.Common;
public class CameraUIController : MonoBehaviour {
public Canvas CameraCanvas;
public Canvas tempManagementUI;
public Button MoveButton;
public Button AttackButton;
public Button SkillButton;
public Button WaitButton;
public GameObject UnitInfo;
public GameObject Actions;
public GameObject TurnEnd;
public Image Portrait;
public Text UnitName;
public Text UnitAttack;
public Text UnitDefence;
public Text UnitAP;
public Text UnitHP;
private GameObject gameManagerObject;
private GameManager gameManager;
private Presenter mPresenter;
/*public void SkillButtonMethod()
{
Debug.Log("SkillButton");
if(mPresenter.SelectedActor == null)
{
return;
}
Debug.Log(mPresenter.SelectedActor.GetType());
if (mPresenter.SelectedActor.GetType() == typeof(Pioneer))
{
mPresenter.CommandNumeric(0);
Debug.Log("Pioneer set City");
}
}*/
/*public void WaitButtonMethod()
{
Debug.Log("WaitButton");
mPresenter.CommandSkip();
}*/
/*public void AttackButtonMethod()
{
Debug.Log("AttackButton");
if(caseA)
mPresenter.CommandMovingAttack();
else(caseA)
mPresenter.CommandHoldingAttack
}*/
public void ActiveCameraUI(bool value)
{
UnitInfo.SetActive(value);
Actions.SetActive(value);
TurnEnd.SetActive(value);
}
// Use this for initialization
void Start ()
{
gameManagerObject = GameManager.I.gameObject;
gameManager = GameManager.I;
tempManagementUI.enabled = false;
}
// Update is called once per frame
void Update ()
{
if(mPresenter.SelectedActor == null)
{
MoveButton.enabled = false;
}
else
{
if (mPresenter.SelectedActor.RemainAP == 0)
{
MoveButton.enabled = false;
}
else
{
MoveButton.enabled = true;
}
}
if(mPresenter.SelectedActor == null)
{
UnitInfo.SetActive(false);
UnitName.text = "공허";
UnitAttack.text = "공격력 : 무한";
UnitDefence.text = "방어력 : 무한";
UnitAP.text = "어디든지";
}
else
{
UnitInfo.SetActive(true);
UnitName.text = mPresenter.SelectedActor.GetType().ToString().Replace("CivModel.Common.","");
UnitAttack.text = "공격력 : " + mPresenter.SelectedActor.AttackPower.ToString();
UnitDefence.text = "방어력 : " + mPresenter.SelectedActor.DefencePower.ToString();
UnitAP.text = mPresenter.SelectedActor.RemainAP + "/" + mPresenter.SelectedActor.MaxAP;
UnitHP.text = mPresenter.SelectedActor.RemainHP + "/" + mPresenter.SelectedActor.MaxHP;
}
}
}
fileFormatVersion: 2
guid: fd593fcf21b7651488dc22c010c87e95
timeCreated: 1519293669
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -43,7 +43,8 @@ public class GameManager : MonoBehaviour {
private int _standbyUnitIndex = -1;
// Use this for initialization
void Start() {
void Awake()
{
// Singleton
if (_manager != null)
{
......@@ -56,10 +57,12 @@ 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.StartTurn();
}
void Start() {
// Instantiate game
_game = new CivModel.Game( GameInfo.mapWidth, GameInfo.mapHeight, GameInfo.numOfPlayer, new CivModel.Common.GameSchemeFactory());
_game.StartTurn();
// Map tiling
innerRadius = outerRadius * Mathf.Sqrt(3.0f) / 2;
......@@ -229,7 +232,6 @@ public class GameManager : MonoBehaviour {
Focus(city.PlacedPoint.Value);
}
}
PseudoFSM.I.NormalStateEnter();
}
......@@ -275,3 +277,11 @@ public class GameManager : MonoBehaviour {
PseudoFSM.I.NormalStateEnter();
}
}
public static class ProductionFactoryTraits
{
public static string GetFactoryName(CivModel.IProductionFactory Factory)
{
return Factory.ToString();
}
}
\ No newline at end of file
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using CivPresenter;
using CivModel;
using CivModel.Common;
public class ManagementUIController : MonoBehaviour {
private static ManagementUIController managementUIController;
public Canvas managementUI;
private LinkedList<Production> mProduction;
private LinkedList<Production> mDeployment;
private IReadOnlyList<IProductionFactory> facList;
//private IReadOnlyList<Player> mPlayers;
private GameObject gameManagerObject;
private GameManager gameManager;
private PseudoFSM state;
private Game game;
private List<GameObject> PQlist;
private List<GameObject> DQlist;
private List<GameObject> SQlist;
public GameObject proPrefab;
public GameObject depPrefab;
public GameObject productablePrefab; // prefab templates
public GameObject proQueue;
public GameObject depQueue;
public GameObject productableQueue;
public void SetManagementUI(bool val)
{
Debug.Log("manUI : " + val);
managementUI.enabled = val;
}
public void ManageFunction() // Management tab on/off button -> ManageMentUIActive
{
List<GameObject> tempList = new List<GameObject>();
Debug.Log("SelectList startMaking");
foreach (GameObject sq in SQlist)
{
Destroy(sq);
}
SQlist.Clear();
facList = game.PlayerInTurn.GetAvailableProduction();
Debug.Log(facList + " " + facList.Count);
Debug.Log("facList : " + facList.Count);
Debug.Log("SelectList Updated");
foreach (IProductionFactory fac in facList)
{
var SPrefab = Instantiate(productablePrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
SPrefab.transform.SetParent(productableQueue.transform);
SPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
SPrefab.transform.localPosition = new Vector3(0f, 0f, 0f);
tempList.Add(SPrefab.GetComponent<SelPrefab>().MakeItem(fac));
}
if (facList.Count == 0)
{
Debug.Log("SelectList null");
var SPrefab = Instantiate(productablePrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
SPrefab.transform.SetParent(productableQueue.transform);
SPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
SPrefab.transform.localPosition = new Vector3(0f, 0f, 0f);
SPrefab.GetComponent<SelPrefab>().MakeItem();
tempList.Add(SPrefab);
}
SQlist = tempList;
MakeProductionQ();
MakeDeploymentQ();
foreach (GameObject sq in SQlist)
{
sq.GetComponent<SelPrefab>().SetButton(SQlist.IndexOf(sq));
}
foreach (GameObject dq in DQlist)
{
dq.GetComponent<DepPrefab>().SetButton(DQlist.IndexOf(dq));
}
}
void Awake()
{
DontDestroyOnLoad(this);
if (managementUIController == null)
{
managementUIController = this;
}
else
{
Destroy(this);
}
}
void Start()
{
if (managementUIController == this)
{
gameManager = GameManager.I;
//mPresenter = gameManager.GetPresenter();
game = gameManager.Game;
state = PseudoFSM.I;
//mPlayers = mGame.Players;
SQlist = new List<GameObject>();
PQlist = new List<GameObject>();
DQlist = new List<GameObject>();
}
else
{
Destroy(this);
}
}
void Update()
{
Debug.Log(game);
mProduction = game.PlayerInTurn.Production;
mDeployment = game.PlayerInTurn.Deployment;
}
public void MakeProductionQ()
{
List<GameObject> tempList = new List<GameObject>();
Debug.Log("ProductionList startMaking");
foreach (GameObject pq in PQlist)
{
Destroy(pq);
}
PQlist.Clear();
mProduction = game.PlayerInTurn.Production;
Debug.Log("ProList : " + mProduction.Count);
Debug.Log("ProductionList Updated");
foreach (Production prod in mProduction)
{
var PPrefab = Instantiate(proPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
PPrefab.transform.SetParent(proQueue.transform);
PPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
PPrefab.transform.localPosition = new Vector3(0f, 0f, 0f);
tempList.Add(PPrefab.GetComponent<ProPrefab>().MakeItem(prod));
}
if (mProduction.Count == 0)
{
Debug.Log("ProductionList null");
var PPrefab = Instantiate(proPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
PPrefab.transform.SetParent(proQueue.transform);
PPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
PPrefab.transform.localPosition = new Vector3(0f, 0f, 0f);
PPrefab.GetComponent<ProPrefab>().MakeItem();
tempList.Add(PPrefab);
}
PQlist = tempList;
}
public void MakeDeploymentQ()
{
List<GameObject> tempList = new List<GameObject>();
Debug.Log("DeploymentList startMaking");
foreach (GameObject dq in DQlist)
{
Destroy(dq);
}
DQlist.Clear();
mDeployment = game.PlayerInTurn.Deployment;
Debug.Log("DepList : " + mDeployment.Count);
Debug.Log("DeploymentList Updated");
foreach (Production prod in mDeployment)
{
var DPrefab = Instantiate(depPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
DPrefab.transform.SetParent(depQueue.transform);
DPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
DPrefab.transform.localPosition = new Vector3(0f, 0f, 0f);
tempList.Add(DPrefab.GetComponent<DepPrefab>().MakeItem(prod));
}
if (mDeployment.Count == 0)
{
Debug.Log("DeploymentList null");
var DPrefab = Instantiate(depPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity);
DPrefab.transform.SetParent(depQueue.transform);
DPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
DPrefab.transform.localPosition = new Vector3(0f, 0f, 0f);
tempList.Add(DPrefab.GetComponent<DepPrefab>().MakeItem());
tempList.Add(DPrefab);
}
DQlist = tempList;
}
/*public static void PrefabsSetting()
{
//ProPrefab.SetPresenter();
DepPrefab.SetPresenter();
SelPrefab.SetPresenter();
}*/
public static ManagementUIController GetManagementUIController()
{
if(managementUIController == null)
{
Debug.Log("managementUIController not made");
throw new MissingComponentException();
}
return managementUIController;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 9fa49bf9c6a37bc41a2d8a6cb4979647
timeCreated: 1519293669
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 852cf395fcb82a2409345ba7af8c036e
folderAsset: yes
timeCreated: 1519293574
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using CivModel;
using CivModel.Common;
public class DepPrefab : MonoBehaviour {
private static ManagementUIController uicontroller;
private Text[] textarguments;
private Image unitPrt;
private Button[] buttons;
// Use this for initialization
void Awake()
{
Debug.Log("call DepPre");
textarguments = gameObject.GetComponentsInChildren<Text>();
foreach (Image unt in gameObject.GetComponentsInChildren<Image>())
{
if (unt.name == "Portrait")
{
unitPrt = unt;
}
}
buttons = gameObject.GetComponentsInChildren<Button>();
}
void Start()
{
uicontroller = ManagementUIController.GetManagementUIController();
}
public GameObject MakeItem(Production prod)
{
string nameofProduction = ProductionFactoryTraits.GetFactoryName(prod.Factory);
unitPrt.sprite = Resources.Load<Sprite>("Unit_portrait/" + nameofProduction + "_portrait");
foreach (Text txt in textarguments)
{
switch (txt.name)
{
case "UnitName":
txt.text = nameofProduction;
break;
case "NumberOfUnits":
txt.text = "X 1";
break;
}
}
return this.gameObject;
}
public GameObject MakeItem()
{
unitPrt.enabled = false;
foreach (Text txt in textarguments)
{
switch (txt.name)
{
case "UnitName":
txt.text = "비었음";
break;
case "NumberOfUnits":
txt.text = "";
break;
}
}
foreach (Button but in buttons)
{
but.gameObject.SetActive(false);
}
return this.gameObject;
}
// Update is called once per frame
void Update () {
}
public void SetButton(int i)
{
}
}
fileFormatVersion: 2
guid: 9642702daf79c1240b7c6a4c15881e8a
timeCreated: 1519304197
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using CivModel;
using CivModel.Common;
public class ProPrefab : MonoBehaviour {
private Text[] textarguments;
private Image unitPrt;
private Button[] buttons;
// Use this for initialization
void Awake()
{
Debug.Log("call ProPre");
textarguments = gameObject.GetComponentsInChildren<Text>();
foreach (Image unt in gameObject.GetComponentsInChildren<Image>())
{
if (unt.name == "Portrait")
{
unitPrt = unt;
}
}
buttons = gameObject.GetComponentsInChildren<Button>();
}
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public GameObject MakeItem(Production prod)
{
string nameofProduction = ProductionFactoryTraits.GetFactoryName(prod.Factory);
unitPrt.sprite = Resources.Load<Sprite>("Unit_portrait/" + nameofProduction + "_portrait");
foreach (Text txt in textarguments)
{
switch (txt.name)
{
case "TurnsLeft":
txt.text = "?턴 이후 배치 가능.";
break;
case "UnitName":
txt.text = nameofProduction;
break;
case "Required Resource":
txt.text = "금 : 턴당 " + "?" + " (" + "?" + "/" + Convert.ToInt32(prod.TotalCost).ToString() + ")"+"\n노동력 : 턴당 " + "?" + " (" + Convert.ToInt32(prod.LaborInputed).ToString() + "/" + Convert.ToInt32(prod.TotalCost).ToString() + ")";
break;
}
}
return this.gameObject;
}
public GameObject MakeItem()
{
unitPrt.enabled = false;
foreach (Text txt in textarguments)
{
switch (txt.name)
{
case "TurnsLeft":
txt.text = "비었음";
break;
case "UnitName":
txt.text = "B었음";
break;
case "Required Resource":
txt.text = "";
break;
}
}
foreach (Button but in buttons)
{
but.gameObject.SetActive(false);
}
return this.gameObject;
}
public void SetButton(int i)
{
if(i == -1)
{
foreach (Button but in buttons)
{
but.enabled = false;
}
}
else
{
foreach (Button but in buttons)
{
}
}
}
}
fileFormatVersion: 2
guid: 617a8b6afcceae548bd2185fc96067cf
timeCreated: 1519304176
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using CivModel;
using CivModel.Common;
public class SelPrefab : MonoBehaviour
{
private static ManagementUIController uicontroller;
private Text[] textarguments;
private Image unitPrt;
private Button[] buttons;
// Use this for initialization
void Awake()
{
Debug.Log("call SelPre");
textarguments = gameObject.GetComponentsInChildren<Text>();
foreach (Image unt in gameObject.GetComponentsInChildren<Image>())
{
if (unt.name == "Portrait")
{
unitPrt = unt;
}
}
buttons = gameObject.GetComponentsInChildren<Button>();
}
void Start ()
{
uicontroller = ManagementUIController.GetManagementUIController();
}
public GameObject MakeItem(IProductionFactory fact)
{
Debug.Log("Selection Queue Item Made");
string nameofFactory = ProductionFactoryTraits.GetFactoryName(fact);
unitPrt.sprite = Resources.Load<Sprite>("Unit_portrait/" + nameofFactory + "_portrait");
foreach (Text txt in textarguments)
{
switch (txt.name)
{
case "UnitName":
txt.text = nameofFactory;
break;
case "NumberOfUnits":
txt.text = "X 1";
break;
}
}
return this.gameObject;
}
public GameObject MakeItem()
{
unitPrt.enabled = false;
Debug.Log("NULL Selection Queue");
foreach (Text txt in textarguments)
{
switch (txt.name)
{
case "UnitName":
txt.text = "생산 가능 유닛 없음.";
txt.fontSize = Screen.height / 40;
break;
case "NumberOfUnits":
txt.text = "";
break;
}
}
foreach (Button but in buttons)
{
but.gameObject.SetActive(false);
}
return this.gameObject;
}
public void SetButton(int i)
{
foreach (Button but in buttons)
{
if (but.name == "Produce")
{
but.onClick.AddListener(delegate () { ProduceItem(i); });
}
}
}
private void ProduceItem(int i)
{
for (int k = 0; k < i; k++)
{
//presenter.CommandArrowKey(Direction.Down);
//i 번의 Selection thing 을 고르는 코드를 적자. 아직은 어떻게 골라야 할까? 일단 미루자.
}
uicontroller.MakeProductionQ();
uicontroller.MakeDeploymentQ();
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: 668b75e98a9b4fb42b9ba5f3cb35c87b
timeCreated: 1519304166
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -20,7 +20,7 @@ public class PseudoFSM : MonoBehaviour {
private CivModel.Terrain.Point?[] _parameterPoints;
// Use this for initialization
void Start () {
void Awake () {
// Singleton
if (_fsm != null)
{
......@@ -187,4 +187,8 @@ public class PseudoFSM : MonoBehaviour {
}
}
}
public bool CheckNormalState()
{
return !(_inMoveState || _inAttackState || _inSkillState);
}
}
......@@ -28,6 +28,12 @@ public class UIManager : MonoBehaviour {
public GameObject EpicTab, HighTab, IntermediateTab, LowTab; // Unit production
public GameObject CityTab, CityBuildingTab, NormalBuildingTab; // Building production
private ManagementUIController uicontroller;
void Start()
{
uicontroller = ManagementUIController.GetManagementUIController();
}
void Update()
{
if (GameManager.I.isThereTodos)
......@@ -51,6 +57,7 @@ public class UIManager : MonoBehaviour {
{
SkillSet.SetActive(false);
ManagementUI.SetActive(true);
uicontroller.ManageFunction();
MapUI.SetActive(false);
QuestUI.SetActive(false);
}
......
Subproject commit 93c6ba947f6bc2aa1da061bcabd226ff44be0dbf
Subproject commit 2ed257461d56de22a8de856714ae1b490a0e58eb
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