void Start()
    {
        gameUtil       = new DartGameUtils();
        colorIndex     = 1;
        betAmountIndex = 0;

        RefreshComponentsAndData();

        PopupCanvas.SetActive(true);
    }
Esempio n. 2
0
    void Start()
    {
        genericInfoPopup.gameObject.SetActive(false);
        userName.text = GameManager.userInfo.name;
        gameUtil      = new DartGameUtils();
        betAmount     = gameUtil.betamountList[gameUtil.betamountList.Length - 1];
        betColour     = UnityEngine.Random.Range(1, 7);
        GameManager.playerBets.Clear();
        DartGameUtils.BetStructure betStruct = new DartGameUtils.BetStructure
        {
            BetAmount = betAmount,
            BetColour = betColour
        };
        GameManager.playerBets.Add(betStruct);
        GameManager.GetInstance().SetCurrentGameMode(DartGameUtils.GameMode.SinglebetMode);

        betcolorIndicator.GetComponent <Image>().color = gameUtil.colourMap[betColour];
        betAmountDisplay.text = betAmount.ToString();
        isInitialized         = true;
    }
Esempio n. 3
0
    public void HitOnDartBoard(Color cellColor)
    {
        enableColorTimer = false;
        FindObjectOfType <AudioEffectsController>().Play("HitSound");

        // Debug.Log("Collided with dart Cube");
        DartGameUtils gameUti = new DartGameUtils();

        if (cellColor == (gameUti.colourMap[currentBetColor]))
        {
            Debug.Log("Hit on correct color: " + cellColor.ToString() + ", aim: " + gameUti.colourMap[currentBetColor].ToString());
            throwResultArray[noOfDartsThrown - 1] = 1;
            hudCanvas.GetComponent <CommentaryManager>().ToggleIndicator(noOfDartsThrown, 1);
        }
        else
        {
            Debug.Log("Hit on wrong color: " + cellColor.ToString() + ", aim: " + gameUti.colourMap[currentBetColor].ToString());
            throwResultArray[noOfDartsThrown - 1] = 0;
            hudCanvas.GetComponent <CommentaryManager>().ToggleIndicator(noOfDartsThrown, 2);
        }
        StartCoroutine(ProcessResultAndProceedToNext());
    }
Esempio n. 4
0
    public void SetTargetColor(int currentColor)
    {
        DartGameUtils gameUti = new DartGameUtils();

        targetColor.color = gameUti.colourMap[currentColor];
    }