Exemplo n.º 1
0
    void Start()
    {
        UpdateScore();
        GameConstants.roundNumber = 1;
        if (UnityEngine.Random.Range(0, 2) == 0)
        {
            IsPlayerTurn  = true;
            turnText.text = "Ты ходишь первым в этот раз.";
        }
        else
        {
            IsPlayerTurn  = false;
            turnText.text = "Я хожу первым в этот раз.";
        }

        suits.Add(0, heartPref);
        suits.Add(1, clubPref);
        suits.Add(2, diamondPref);
        suits.Add(3, spadePref);

        backSpawnPoint = GameObject.Find("Background");
        allCells       = GameObject.FindGameObjectsWithTag("Cell")
                         .Select(comp => comp.GetComponent <CellSlot>())
                         .Where(comp => comp != null).ToArray();

        suitsManager = FindObjectOfType <SuitsManager>();
        bot          = FindObjectOfType <BattleBot>();

        GameConstants.gameMode = 2;
    }
Exemplo n.º 2
0
 void Start()
 {
     battle       = FindObjectOfType <Battle>();
     suitsManager = FindObjectOfType <SuitsManager>();
     for (var i = 0; i < previewCards.Count; i++)
     {
         previewCardsPos.Add(previewCards[i].transform.position);
     }
 }
Exemplo n.º 3
0
 //public static DragAndDrop singleton;
 public void Start()
 {
     suitsManager     = FindObjectOfType <SuitsManager>();
     canvas           = FindObjectOfType <Canvas>();
     OnCardDragBegin -= OffBlockRaycast;
     OnCardDragBegin += OffBlockRaycast;
     OnCardDragEnd   -= OnBlockRaycast;
     OnCardDragEnd   += OnBlockRaycast;
 }
Exemplo n.º 4
0
    void Start()
    {
        //if (GameConstants.gameMode == 2)
        //{
        //    IsCellEmpty = true;
        //}
        if (GameConstants.steps == null)
        {
            GameConstants.steps = new Stack <string>();
        }
        GameConstants.usedCellSlots = new Stack <CellSlot>();

        suitsManager    = FindObjectOfType <SuitsManager>();
        trainingManager = FindObjectOfType <Training>();
        battle          = FindObjectOfType <Battle>();

        cellSlotFake = GameObject.Find("CellSlotFake");

        var ChildsTransforms = GetComponentsInChildren <Transform>();

        cellSlotFakes = ChildsTransforms
                        .Where(comp => comp.gameObject.tag == "CellSlotFake")
                        .Select(comp => comp.gameObject).ToArray();
        //decimalsText = new List<Text>();
        //decimalsText.Add(decimals1);
        //decimalsText.Add(decimals2);

        if (decimals.Count != 0)
        {
            int i = 0;
            foreach (var e in decimals)
            {
                var nums = e.Split('/');
                rightDecimal *= double.Parse(nums[0]) / double.Parse(nums[1]);
                //text_dec.text = nums[0] + "\n—" + nums[1];

                //decimalsText[i].text = nums[0] + "\n—\n" + nums[1];
                cellSlotFakes[i].transform.GetChild(0).GetComponent <Text>().text = nums[0];
                cellSlotFakes[i].transform.GetChild(1).GetComponent <Text>().text = nums[1];
                i++;
            }

            //decimalsText.text = decimals[0] + " * " + decimals[1];
        }
    }