Skip to content

Commit

Permalink
コードを最適化 バグを修正 V2.0のビルド準備
Browse files Browse the repository at this point in the history
  • Loading branch information
tokyosuperch committed Jan 17, 2019
1 parent 8df8e30 commit 0fd25d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 58 deletions.
73 changes: 18 additions & 55 deletions Assets/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ public void KomaClick(string komaname) {
destroyedname = "";
GameObject temporary = null;
temporary = ObjectReturner(komaname.Substring(0, 1), int.Parse(komaname.Substring(1, 1)));
select.transform.position = temporary.transform.position;
select.SetActive(true);
if ((senteturn == true && iamsente == true) || (senteturn == false && iamsente == false)) {
select.transform.position = temporary.transform.position;
select.SetActive(true);
}
if (temporary == null) { // エラー時の暴走防止
usermsg = "内部エラー";
msgshow = true;
Expand All @@ -334,75 +336,36 @@ public void KomaClick(string komaname) {
msgshow = true;
} else {
char[] initial = temporary.name.Substring(0, 1).ToCharArray();
if (senteturn && iamsente == true) {
if (senteturn) {
if (char.IsLower(initial[0])) {
moving = temporary;
if (moving.name.Length >= 3) {
beforex = int.Parse(moving.name.Substring(1, 1));
beforey = int.Parse(moving.name.Substring(2, 1));
} else {
beforex = -1;
beforey = -1;
}
movemode = true;
} else if (movemode == true && komauchimode == false && temporary.name.Length > 1) {
destroyedname = temporary.name;
MasuClick(temporary.name.Substring(1, 1) + temporary.name.Substring(2, 1));
}
} else if (!senteturn && iamsente == false) {
if (char.IsUpper(initial[0])) {
moving = temporary;
if (moving.name.Length >= 3) {
beforex = int.Parse(moving.name.Substring(1, 1));
beforey = int.Parse(moving.name.Substring(2, 1));
} else {
beforex = -1;
beforey = -1;
}
movemode = true;
if (iamsente == true) moving = temporary;
if (iamsente == false && enemymove) moving = temporary;
} else if (movemode == true && komauchimode == false && temporary.name.Length > 1) {
destroyedname = temporary.name;
MasuClick(temporary.name.Substring(1, 1) + temporary.name.Substring(2, 1));
}
} else if (enemymove && iamsente == true && !senteturn) {
} else {
if (char.IsUpper(initial[0])) {
moving = temporary;
if (moving.name.Length >= 3) {
beforex = int.Parse(moving.name.Substring(1, 1));
beforey = int.Parse(moving.name.Substring(2, 1));
} else {
beforex = -1;
beforey = -1;
}
movemode = true;
} else if (movemode == true && komauchimode == false && temporary.name.Length > 1) {
destroyedname = temporary.name;
MasuClick(temporary.name.Substring(1, 1) + temporary.name.Substring(2, 1));
}
} else if (enemymove && iamsente == false && senteturn) {
if (char.IsLower(initial[0])) {
moving = temporary;
if (moving.name.Length >= 3) {
beforex = int.Parse(moving.name.Substring(1, 1));
beforey = int.Parse(moving.name.Substring(2, 1));
} else {
beforex = -1;
beforey = -1;
}
movemode = true;
if (iamsente == false) moving = temporary;
if (iamsente == true && enemymove) moving = temporary;
} else if (movemode == true && komauchimode == false && temporary.name.Length > 1) {
destroyedname = temporary.name;
MasuClick(temporary.name.Substring(1, 1) + temporary.name.Substring(2, 1));
}
}
}
if (moving != null) {
if (moving.name.Length < 3) {
if (moving.name.Length >= 3) {
beforex = int.Parse(moving.name.Substring(1, 1));
beforey = int.Parse(moving.name.Substring(2, 1));
komauchimode = false;
} else {
beforex = -1;
beforey = -1;
komauchimode = true;
komatype = moving.name.Substring(0, 1);
} else {
komauchimode = false;
}
movemode = true;
}
}

Expand Down
6 changes: 3 additions & 3 deletions Assets/Title.unity
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 50}
m_SizeDelta: {x: 720, y: 480}
m_AnchoredPosition: {x: 0, y: -40}
m_SizeDelta: {x: 720, y: 640}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1444818455
MonoBehaviour:
Expand Down Expand Up @@ -573,7 +573,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\u30AA\u30F3\u30E9\u30A4\u30F3\u5BFE\u6226\u306F\u3069\u3046\u3076\u3064\u3057\u3087\u3046\u304E\u30B5\u30FC\u30D0\u30FC\u3068\u901A\u4FE1\u304C\u3067\u304D\u308B\u5834\u6240\u306B\u9650\u3089\u308C\u307E\u3059\u306E\u3067\u3054\u6CE8\u610F\u304F\u3060\u3055\u3044\u3002\n\u203B2019\u5E74\u73FE\u5728\u30AD\u30E3\u30F3\u30D1\u30B9\u5185\u306E\u307F"
m_Text: "\u30AA\u30F3\u30E9\u30A4\u30F3\u5BFE\u6226\u306F\u3069\u3046\u3076\u3064\u3057\u3087\u3046\u304E\u30B5\u30FC\u30D0\u30FC\u3068\u901A\u4FE1\u304C\u3067\u304D\u308B\u5834\u6240\u306B\u9650\u3089\u308C\u307E\u3059\u306E\u3067\u3054\u6CE8\u610F\u304F\u3060\u3055\u3044\u3002\n\u203B2019\u5E741\u6708\u73FE\u5728\u30AD\u30E3\u30F3\u30D1\u30B9\u5185CNS\u306E\u307F"
--- !u!222 &1444818456
CanvasRenderer:
m_ObjectHideFlags: 0
Expand Down

0 comments on commit 0fd25d3

Please sign in to comment.