static EndGameDef() { // Note: this type is marked as 'beforefieldinit'. EndGameDef.SuitDirection[,] array = new EndGameDef.SuitDirection[9, 10]; array[0, 0] = EndGameDef.SuitDirection.Normal; array[0, 1] = EndGameDef.SuitDirection.Invert; array[1, 0] = EndGameDef.SuitDirection.Normal; array[1, 1] = EndGameDef.SuitDirection.Normal; array[1, 2] = EndGameDef.SuitDirection.Invert; array[2, 0] = EndGameDef.SuitDirection.Normal; array[2, 1] = EndGameDef.SuitDirection.Invert; array[2, 2] = EndGameDef.SuitDirection.Normal; array[2, 3] = EndGameDef.SuitDirection.Invert; array[3, 0] = EndGameDef.SuitDirection.Normal; array[3, 1] = EndGameDef.SuitDirection.Invert; array[3, 2] = EndGameDef.SuitDirection.Normal; array[3, 3] = EndGameDef.SuitDirection.Normal; array[3, 4] = EndGameDef.SuitDirection.Invert; array[4, 0] = EndGameDef.SuitDirection.Normal; array[4, 1] = EndGameDef.SuitDirection.Normal; array[4, 2] = EndGameDef.SuitDirection.Invert; array[4, 3] = EndGameDef.SuitDirection.Normal; array[4, 4] = EndGameDef.SuitDirection.Normal; array[4, 5] = EndGameDef.SuitDirection.Invert; array[5, 0] = EndGameDef.SuitDirection.Normal; array[5, 1] = EndGameDef.SuitDirection.Normal; array[5, 2] = EndGameDef.SuitDirection.Invert; array[5, 3] = EndGameDef.SuitDirection.Normal; array[5, 4] = EndGameDef.SuitDirection.Normal; array[5, 5] = EndGameDef.SuitDirection.Normal; array[5, 6] = EndGameDef.SuitDirection.Invert; array[6, 0] = EndGameDef.SuitDirection.Normal; array[6, 1] = EndGameDef.SuitDirection.Normal; array[6, 2] = EndGameDef.SuitDirection.Invert; array[6, 3] = EndGameDef.SuitDirection.Normal; array[6, 4] = EndGameDef.SuitDirection.Invert; array[6, 5] = EndGameDef.SuitDirection.Normal; array[6, 6] = EndGameDef.SuitDirection.Normal; array[6, 7] = EndGameDef.SuitDirection.Invert; array[7, 0] = EndGameDef.SuitDirection.Normal; array[7, 1] = EndGameDef.SuitDirection.Normal; array[7, 2] = EndGameDef.SuitDirection.Invert; array[7, 3] = EndGameDef.SuitDirection.Invert; array[7, 4] = EndGameDef.SuitDirection.Normal; array[7, 5] = EndGameDef.SuitDirection.Normal; array[7, 6] = EndGameDef.SuitDirection.Normal; array[7, 7] = EndGameDef.SuitDirection.Invert; array[7, 8] = EndGameDef.SuitDirection.Invert; array[8, 0] = EndGameDef.SuitDirection.Normal; array[8, 1] = EndGameDef.SuitDirection.Normal; array[8, 2] = EndGameDef.SuitDirection.Invert; array[8, 3] = EndGameDef.SuitDirection.Invert; array[8, 4] = EndGameDef.SuitDirection.Normal; array[8, 5] = EndGameDef.SuitDirection.Invert; array[8, 6] = EndGameDef.SuitDirection.Normal; array[8, 7] = EndGameDef.SuitDirection.Normal; array[8, 8] = EndGameDef.SuitDirection.Invert; array[8, 9] = EndGameDef.SuitDirection.Invert; EndGameDef.ff9endingGameSuitDirection = array; }
private void AssambleCards() { String[] array = new String[] { "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "jack", "queen", "king", "ace" }; String[] array2 = new String[] { "2", "3", "4", "5", "6", "7", "8", "9", "10", "j", "q", "k", "a" }; String[] array3 = new String[] { "diamonds", "clubs", "hearts", "spades" }; Sprite[] array4 = Resources.LoadAll <Sprite>("EmbeddedAsset/EndGame/card_image"); Dictionary <String, Sprite> dictionary = new Dictionary <String, Sprite>(); Sprite[] array5 = array4; for (Int32 i = 0; i < (Int32)array5.Length; i++) { Sprite sprite = array5[i]; dictionary.Add(sprite.name, sprite); } this.GameCards = new List <List <GameObject> >(); for (Int32 j = 0; j < 13; j++) { for (Int32 k = 0; k < 4; k++) { List <GameObject> list = new List <GameObject>(); for (Int32 l = 0; l < 6; l++) { String name = String.Concat(new Object[] { "card_", array[j], "_", array3[k], "_", l }); GameObject gameObject = new GameObject(name); GameObject gameObject2 = new GameObject("background"); gameObject2.AddComponent <SpriteRenderer>(); gameObject2.GetComponent <SpriteRenderer>().sprite = dictionary["card_white.png"]; gameObject2.transform.localScale = new Vector3(1f, 1f, 1f); gameObject2.transform.parent = gameObject.transform; String str = String.Empty; String text = String.Empty; switch (k) { case 0: str = "diamond"; text = "red"; break; case 1: str = "club"; text = "black"; break; case 2: str = "heart"; text = "red"; break; case 3: str = "spade"; text = "black"; break; } String text2 = String.Concat(new String[] { "card_digit_", array2[j], "_", text, "_normal.png" }); String text3 = String.Concat(new String[] { "card_digit_", array2[j], "_", text, "_invert.png" }); String text4 = "card_" + str + "_normal.png"; String text5 = "card_" + str + "_invert.png"; String[] array6 = new String[] { text2, text3, text4, text5 }; Vector3[] array7 = new Vector3[] { new Vector3(3.49f, -3.89f, -2f), new Vector3(22.4f, -30.3f, -2f), new Vector3(3.5f, -10.5f, -2f), new Vector3(22.4f, -24.4f, -2f) }; for (Int32 m = 0; m < 4; m++) { GameObject gameObject3 = new GameObject("symbol_" + array6[m]); gameObject3.AddComponent <SpriteRenderer>(); gameObject3.GetComponent <SpriteRenderer>().sprite = dictionary[array6[m]]; gameObject3.transform.localScale = new Vector3(1f, 1f, 1f); gameObject3.transform.localPosition = array7[m]; gameObject3.transform.parent = gameObject.transform; } Int32 num = j; if (num >= 9) { if (num == 12) { Int32[] array8 = new Int32[] { 22, 30 }; Single x = (Single)array8[0] * 0.42f + 3.4f; Single y = (Single)array8[1] * -0.45f - 3.9f; GameObject gameObject4 = new GameObject("card_face_" + text4); gameObject4.AddComponent <SpriteRenderer>(); gameObject4.GetComponent <SpriteRenderer>().sprite = dictionary[text4]; gameObject4.transform.localScale = new Vector3(1f, 1f, 1f); gameObject4.transform.localPosition = new Vector3(x, y, -2f); gameObject4.transform.parent = gameObject.transform; } else { String text6 = String.Empty; if (num == 9) { text6 = "card_jack.png"; } else if (num == 10) { text6 = "card_queen.png"; } else if (num == 11) { text6 = "card_king.png"; } Int32[] array9 = new Int32[] { 7, 10 }; Single x2 = (Single)array9[0] * 0.42f + 0.7f; Single y2 = (Single)array9[1] * -0.45f - 0.7f; GameObject gameObject5 = new GameObject("card_face_" + text6); gameObject5.AddComponent <SpriteRenderer>(); gameObject5.GetComponent <SpriteRenderer>().sprite = dictionary[text6]; gameObject5.transform.localScale = new Vector3(1f, 1f, 1f); gameObject5.transform.localPosition = new Vector3(x2, y2, -1.5f); gameObject5.transform.parent = gameObject.transform; } } else { for (Int32 n = 0; n <= num + 1; n++) { Int32 num2 = EndGameDef.ff9endingGameSuitLoc[num, n, 0]; Int32 num3 = EndGameDef.ff9endingGameSuitLoc[num, n, 1]; Single x3 = (Single)num2 * 0.42f + 3.4f; Single y3 = (Single)num3 * -0.45f - 3.9f; EndGameDef.SuitDirection suitDirection = EndGameDef.ff9endingGameSuitDirection[num, n]; String text7 = text4; if (suitDirection == EndGameDef.SuitDirection.Invert) { text7 = text5; } GameObject gameObject6 = new GameObject("card_face_" + text7); gameObject6.AddComponent <SpriteRenderer>(); gameObject6.GetComponent <SpriteRenderer>().sprite = dictionary[text7]; gameObject6.transform.localScale = new Vector3(1f, 1f, 1f); gameObject6.transform.localPosition = new Vector3(x3, y3, -2f); gameObject6.transform.parent = gameObject.transform; } } gameObject.transform.parent = this.CanvasPlane.transform; gameObject.transform.position = default(Vector3); gameObject.transform.localScale = new Vector3(0.069f, 0.1f, 0.1f); list.Add(gameObject); } this.GameCards.Add(list); } } }