Commit 7077b7a3 authored by 김주영's avatar 김주영

turn change available

parent ffc87b5d
......@@ -1148,8 +1148,8 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1841507268}
m_HandleRect: {fileID: 1841507267}
m_Direction: 2
m_Value: 1
m_Size: 0.9999999
m_Value: 0
m_Size: 0.9999998
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -2547,7 +2547,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: 0.000027876755}
m_AnchoredPosition: {x: 0, y: -0.00006367598}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &191355288
......@@ -3665,7 +3665,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &307680033
GameObject:
......@@ -4701,7 +4701,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &379750188
GameObject:
......@@ -5088,7 +5088,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.000053677646, y: -0.000008514531}
m_AnchoredPosition: {x: -0.000053677646, y: -0.00005972678}
m_SizeDelta: {x: 0, y: 300}
m_Pivot: {x: 0, y: 1}
--- !u!1 &454209707
......@@ -6493,8 +6493,8 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 733846993}
m_HandleRect: {fileID: 733846992}
m_Direction: 2
m_Value: 0
m_Size: 0.9999996
m_Value: 1
m_Size: 0.9999999
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -8993,7 +8993,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1457256215}
m_Direction: 2
m_Value: 0
m_Size: 0.99999994
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -9689,7 +9689,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.00003090782, y: -0.000008514531}
m_AnchoredPosition: {x: -0.000017556631, y: -0.00005972678}
m_SizeDelta: {x: 0, y: 300}
m_Pivot: {x: 0, y: 1}
--- !u!1 &1001046761
......@@ -9794,7 +9794,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -0.000030517578}
m_AnchoredPosition: {x: 0, y: 0.000030517578}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1004629748
......@@ -12260,8 +12260,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1106515837}
- {fileID: 2028697113}
- {fileID: 1797784854}
- {fileID: 2028697113}
- {fileID: 1544955426}
m_Father: {fileID: 194350972}
m_RootOrder: 1
......@@ -14151,7 +14151,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.00001036023, y: -0.000088779976}
m_AnchoredPosition: {x: -0.00001036023, y: 0.000010931467}
m_SizeDelta: {x: 0, y: 300}
m_Pivot: {x: 0, y: 1}
--- !u!1 &1465630758
......@@ -15758,7 +15758,18 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1633964638}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 10455584}
m_MethodName: onClickNextTurn
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &1633964638
......@@ -17697,7 +17708,7 @@ RectTransform:
- {fileID: 950447974}
- {fileID: 28127897}
m_Father: {fileID: 1212682353}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
......@@ -20440,8 +20451,8 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 177526370}
m_HandleRect: {fileID: 177526369}
m_Direction: 2
m_Value: 1
m_Size: 0.9999998
m_Value: 0
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -20854,7 +20865,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1833688074}
m_HandleRect: {fileID: 1833688073}
m_Direction: 2
m_Value: 0
m_Value: 1
m_Size: 0.99999994
m_NumberOfSteps: 0
m_OnValueChanged:
......@@ -21492,7 +21503,7 @@ RectTransform:
- {fileID: 335664604}
- {fileID: 1185608718}
m_Father: {fileID: 1212682353}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
......@@ -21818,7 +21829,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 145151054}
m_HandleRect: {fileID: 145151053}
m_Direction: 2
m_Value: 0
m_Value: 1
m_Size: 0.99999994
m_NumberOfSteps: 0
m_OnValueChanged:
......
......@@ -3,6 +3,8 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CivModel;
using System.Threading.Tasks;
public class GameManager : MonoBehaviour {
......@@ -57,9 +59,6 @@ public class GameManager : MonoBehaviour {
_game = new CivModel.Game(".\\Assets\\map.txt", factories);
_game.StartTurn();
// Use Only for TESTING!
_game.EndTurn();
_game.StartTurn();
}
// Use this for initialization
......@@ -67,6 +66,7 @@ public class GameManager : MonoBehaviour {
InitiateMap();
InitiateUnit();
InitiateMiniMap();
InitiateTurn();
}
// Update is called once per frame
......@@ -204,6 +204,39 @@ public class GameManager : MonoBehaviour {
}
}
private void InitiateTurn() {
//// Use Only for TESTING!
_game.EndTurn();
_game.StartTurn();
foreach (Player plyr in _game.Players)
{
plyr.IsAIControlled = true;
}
_game.Players[0].IsAIControlled = false;
}
public async Task ProceedTurn()
{
//Debug.Log(Game.PlayerNumberInTurn);
if(_game.PlayerInTurn == _game.Players[0])
_game.EndTurn();
_game.StartTurn();
while (_game.PlayerInTurn.IsAIControlled)
{
//Debug.Log(Game.PlayerNumberInTurn);
await _game.PlayerInTurn.DoAITurnAction();
_game.EndTurn();
_game.StartTurn();
}
UpdateMap();
UpdateUnit();
//if (_game.PlayerInTurn == _game.Players[0])
//_game.StartTurn();
}
public static Vector3 ModelPntToUnityPnt(CivModel.Terrain.Point pt, float yPos) {
Vector3 unityPoint = new Vector3(2 * pt.Position.X * (Mathf.Sqrt(3) / 2), yPos, -pt.Position.Y * 1.5f);
if ((pt.Position.Y % 2) != 0)
......
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using CivModel;
using System.Threading.Tasks;
public class GameUI : MonoBehaviour {
......@@ -25,7 +26,7 @@ public class GameUI : MonoBehaviour {
{
mapUI.transform.Find("EndTurn").GetComponentInChildren<Button>().enabled = false;
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "다른 플레이어가 턴 진행 중입니다. 기다려 주십시오.";
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 40;
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 20;
}
else
{
......@@ -34,18 +35,18 @@ public class GameUI : MonoBehaviour {
if (GameManager.Instance.isThereTodos && !PseudoFSM.Instance.DepState)
{
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "유닛이 명령을 기다리고 있습니다";
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 15;
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = 30;
}
else if (PseudoFSM.Instance.DepState)
{
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "배치 취소";
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 10;
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = 40;
}
else
{
*/
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().text = "다음 턴";
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = Screen.height / 10;
mapUI.transform.Find("EndTurn").GetComponentInChildren<Text>().fontSize = 40;
//}
updatePanel();
......@@ -82,4 +83,9 @@ public class GameUI : MonoBehaviour {
{
managementcontroller.begin();
}
public void onClickNextTurn()
{
GameManager.Instance.ProceedTurn();
}
}
\ No newline at end of file
......@@ -93,18 +93,16 @@ public class Unit : MonoBehaviour {
{
CivModel.Position pos = _parameterPoints[i].Value.Position;
GameManager.Instance.Tiles[pos.X, pos.Y].GetComponent<HexTile>().FlickerRed();
Debug.Log(pos.X + " " + pos.Y + " Filcker Red");
}
else if (GameManager.Instance.selectedActor.MoveAct.IsActable(_parameterPoints[i]))
{
CivModel.Position pos = _parameterPoints[i].Value.Position;
GameManager.Instance.Tiles[pos.X, pos.Y].GetComponent<HexTile>().FlickerBlue();
Debug.Log(pos.X + " " + pos.Y + " Filcker Blue");
}
else
{
CivModel.Position pos = _parameterPoints[i].Value.Position;
Debug.Log("Cannot Move to (" + pos.X + ", " + pos.Y + ")");
//Debug.Log("Cannot Move to (" + pos.X + ", " + pos.Y + ")");
}
}
IEnumerator _coroutine = MoveUnit(GameManager.Instance.selectedActor);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -20,7 +20,7 @@ MonoBehaviour:
m_ShowMode: 4
m_Title:
m_RootView: {fileID: 2}
m_MinSize: {x: 950, y: 542}
m_MinSize: {x: 950, y: 300}
m_MaxSize: {x: 10000, y: 10000}
--- !u!114 &2
MonoBehaviour:
......@@ -106,10 +106,10 @@ MonoBehaviour:
y: 30
width: 1278
height: 665
m_MinSize: {x: 683, y: 492}
m_MinSize: {x: 679, y: 492}
m_MaxSize: {x: 14004, y: 14042}
vertical: 0
controlID: 122
controlID: 53
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
......@@ -130,10 +130,10 @@ MonoBehaviour:
y: 0
width: 926
height: 665
m_MinSize: {x: 406, y: 492}
m_MinSize: {x: 402, y: 492}
m_MaxSize: {x: 10002, y: 14042}
vertical: 1
controlID: 73
controlID: 54
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
......@@ -154,10 +154,10 @@ MonoBehaviour:
y: 0
width: 926
height: 394
m_MinSize: {x: 406, y: 221}
m_MaxSize: {x: 8006, y: 4021}
m_MinSize: {x: 402, y: 221}
m_MaxSize: {x: 8002, y: 4021}
vertical: 0
controlID: 74
controlID: 55
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
......@@ -364,9 +364,9 @@ MonoBehaviour:
m_PersistentViewDataDictionary: {fileID: 0}
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 3a070000
m_LastClickedID: 0
m_ExpandedIDs: 22f195ff00000000
m_SelectedIDs: 104a0000
m_LastClickedID: 18960
m_ExpandedIDs: 9ef6fffff0fbffff0000000012450000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
......@@ -542,9 +542,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 70}
m_SelectedIDs: e40c0000
m_LastClickedID: 3300
m_ExpandedIDs: 000000003609000046090000e40c000000ca9a3bffffff7f
m_SelectedIDs: e60c0000
m_LastClickedID: 3302
m_ExpandedIDs: 000000003809000048090000e60c000000ca9a3bffffff7f
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
......@@ -572,7 +572,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 000000003609000046090000e40c0000
m_ExpandedIDs: 000000003809000048090000e60c0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
......
No preview for this file type
......@@ -8,15 +8,3 @@ Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: initializeCompiler
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