Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        jeu   = this.GetComponentInParent <LogicGame>();
        IA    = this.gameObject.transform.parent.GetComponentInChildren <IA>();
        pot   = jeu.gameObject.GetComponentInChildren <LogicPot>();
        _menu = jeu.gameObject.transform.Find("Menu").GetComponent <MenuPlay>();

        jeton  = this.transform.parent.gameObject.GetComponent <AudioSource>();
        toc    = IA.gameObject.GetComponent <AudioSource>();
        couche = jeu.gameObject.GetComponent <AudioSource>();

        this.Initcartes();

        _grossePile = this.transform.Find("JetonPile_1").GetComponent <SpriteRenderer>();
        _moyenPile  = this.transform.Find("JetonPile_2").GetComponent <SpriteRenderer>();
        _petitePile = this.transform.Find("JetonPile_3").GetComponent <SpriteRenderer>();
        _grosTas    = this.transform.Find("JetonTas_1").GetComponent <SpriteRenderer>();
        _moyenTas   = this.transform.Find("JetonTas_3").GetComponent <SpriteRenderer>();
        _petitTas   = this.transform.Find("JetonTas_4").GetComponent <SpriteRenderer>();
        _PersoBras  = this.transform.Find("PersoBras").GetComponent <SpriteRenderer>();
        _PersoMise  = this.transform.Find("PersoMise").GetComponent <SpriteRenderer>();
        _deal       = this.transform.Find("deal").GetComponent <SpriteRenderer>();
        _textMise   = this.transform.Find("Canvas").Find("TextMise").GetComponent <Text>();
        _textJeton  = this.transform.Find("Canvas").Find("TextJeton").GetComponent <Text>();
        _Alea       = this.transform.parent.GetComponentInChildren <AleaVar>();

        _textMise.gameObject.SetActive(false);



        _grossePile.enabled = false;
        _moyenPile.enabled  = false;
        _petitePile.enabled = false;
        _grosTas.enabled    = false;
        _moyenTas.enabled   = false;
        _petitTas.enabled   = false;
        _deal.enabled       = false;
        _PersoBras.enabled  = false;
        _PersoMise.enabled  = false;

        this.AddToNbJeton(3000);

        double bluff = PlayerPrefs.GetInt("Bluff");

        //print("coeff" + bluff);
        _coeffBluff = _Alea.LoiNormale(bluff / 100.0, 0.1);
        if (_coeffBluff < 0)
        {
            _coeffBluff = 0;
        }
        if (_coeffBluff > 1)
        {
            _coeffBluff = 1;
        }
    }
Esempio n. 2
0
    void Start()
    {
        pot          = this.GetComponentInParent <LogicPot>();
        _textTableau = this.transform.parent.parent.Find("TextTableau");
        _Alea        = this.transform.parent.GetComponentInChildren <AleaVar>();


        /*
         * print("Loi Beta");
         * double moyenne = 0;
         * double value = 0;
         * double center = 0;
         * for(int i = 0; i < 100; i++)
         * {
         *  value = _Alea.LoiBeta(3.3, 4.8);
         *  print(value);
         *  moyenne += value;
         *
         *  if (value < 0.5 && value > -0.5) {
         *      center++;
         *  }
         *
         * }
         *
         * print("moyenne: " + moyenne / 100.0);
         * print("center: " + center);
         */
        /*
         * double moyenne = 0;
         * double value;
         * double center = 0;
         * print("Loi Gamma");
         * for (int i = 0; i < 100; i++)
         * {
         *  value = _Alea.LoiGamma(0.1);
         *  moyenne += value;
         *  if (value < 0.5) center++;
         *  print("value: " + value);
         * }
         * print("moyenne: " + moyenne / 100.0);
         * print("center" + center);*/
    }