Results PlayCard(int index) { Results res = Results.Nothing; if (Cards[index].value == localDesk.discardPile.Cards[localDesk.discardPile.Cards.Count - 1].value || Cards[index].color == localDesk.discardPile.Cards[localDesk.discardPile.Cards.Count - 1].color || Cards[index].color == CardColor.Any) { #if true Debug.Log(Cards[index].value); switch (Cards[index].value) { case "CC": //1) Создание пустого объекта ChangeColor в нём создаёшь 4 карты разного цвета с соответствующими названиями red blue yellow green через RenderMaster //2) Вызов ChooseController от owner "ChangeColor" //3) результат ChooseController должен вернуть либо ничего либо цвет CardColor colorPick; RenderMaster.RenderChangeColor(new Vector3(0, 0, 0), true); ChooseController(changeColor.name, Type.Hand); break; case "2Cards": res = Results.TakeCards; break; case "CD": res = Results.ChangeDir; break; case "Skip": res = Results.Skip; break; case "4Cards": #warning Здесь надо дополнительно использовать код из СС. res = Results.TakeCards; break; default: res = Results.NextPlayer; break; } #endif int error = GiveCard(localDesk.discardPile, index, true); if (error == 0) { if (Cards.Count == 0) { return(Results.Victory); } } return(res); } else { Debug.Log("Incorrect"); return(Results.Nothing); } }
public void Render(int shift = 0, bool flip = false) { Quaternion quat = Quaternion.AngleAxis(flip ? 50 : 230, new Vector3(1, 0, 0)); quat *= Quaternion.AngleAxis(180, new Vector3(0, 0, 1)); RenderMaster.Render(this, new Vector3(21 - shift * 1.3f, 0, 50), quat); }
private void Start() { main = this; diagram = new Euclid.Construction("Assets/Custom/Scripts/Constructions/demo.euclid"); Render(); }
public bool Render() { RenderMaster.Render(this, new Vector3(0, 0, 0)); /*float x = 2.5f; * float y = 2 * x; * float z = x; * GameObject handCard; * for(int i = 0; i < localDeck.Cards.Count; ++i) * { * if (!localDeck.Cards[i].isOnScreen) * { * handCard = (GameObject)GameObject.Instantiate(Resources.Load("FPC/PlayingCards_" + localDeck.Cards[i].value + localDeck.Cards[i].GetSuit())); //скачал бесплатные карты * handCard.transform.position = new Vector3(z - x * localDeck.Cards.Count + y * i, -5.5f, 31f - 0.1f * i) + obj.transform.position; * handCard.transform.rotation *= Quaternion.AngleAxis(-90, new Vector3(1, 0, 0)); //повернул на -90 по оси X * handCard.transform.localScale += new Vector3(60, 60, 0); //увеличил в 60 раз * * localDeck.Cards[i].gameobj = handCard; * localDeck.Cards[i].isOnScreen = true; * handCard.gameObject.transform.SetParent(obj.transform); * //Debug.Log(Cards[i].value + " " + Cards[i].type); * } * else * { * localDeck.Cards[i].gameobj.transform.position = new Vector3(z - x * localDeck.Cards.Count + y * i, -5.5f, 31f - 0.1f * i); * } * } * isNewCards = false; */ return(true); }
void RenderCard() { //(2.5f - 2.5f * Cards.Count + 5 * i, -5.5f, 31f - 0.1f * i); RenderMaster.Render(this, new Vector3(0, 0, 0)); }