Exemplo n.º 1
0
    private void SetButtonStatesAndAnimatorsToArrays()
    {
        GamblingBindingManager instance = GamblingBindingManager.Instance;

        m_buttonStates[0]    = ButtonOneState;
        m_buttonStates[1]    = ButtonTwoState;
        m_buttonStates[2]    = ButtonThreeState;
        m_buttonStates[3]    = ButtonFourState;
        m_buttonAnimators[0] = instance.ButtonOne;
        m_buttonAnimators[1] = instance.ButtonTwo;
        m_buttonAnimators[2] = instance.ButtonThree;
        m_buttonAnimators[3] = instance.ButtonFour;
    }
Exemplo n.º 2
0
    private IEnumerator CardSpawnAnimations()
    {
        GamblingBindingManager bind = GamblingBindingManager.Instance;

        bind.CardDim.SetTrigger("CardDimExit");
        bind.CardButtons.GetComponent <Animator>().SetTrigger("HideCards");
        yield return(new WaitForSeconds(1f));

        bind.Machine.SetTrigger("MachineOpen");
        bind.CardButtons.SetActive(value: false);
        yield return(new WaitForSeconds(2f));

        bind.CardDim.SetTrigger("CardDimEnter");
        bind.CardButtons.SetActive(value: true);
    }
Exemplo n.º 3
0
    public GamblingRunner()
    {
        Singleton <PropertyManager> .Instance.AddRootContext(this);

        SceneLoader            root = SceneLoader.Instance;
        GamblingBindingManager bind = GamblingBindingManager.Instance;

        LoadGamblingState();
        SetButtonStatesAndAnimatorsToArrays();
        MaxGamblingLevel.Value = Singleton <EconomyHelpers> .Instance.GetMaxGamblingLevel();

        CurrentGamblingLevel.Subscribe(delegate(int lvl)
        {
            m_gambConf = Singleton <EconomyHelpers> .Instance.GetGamblingConfig(lvl);
        }).AddTo(root);
        FailPaid.Subscribe(delegate(bool paid)
        {
            bind.DrJellyStealPopup.SetActive(!paid);
        }).AddTo(root);
        (from states in m_buttonStates[0].CombineLatest(m_buttonStates[1], m_buttonStates[2], m_buttonStates[3], (int one, int two, int three, int four) => new int[4]
        {
            one,
            two,
            three,
            four
        }).Skip(1)
         where states[0] > 0 || states[1] > 0 || states[2] > 0 || states[3] > 0
         select states).Subscribe(delegate
        {
            root.StartCoroutine(OpenRestCards());
        }).AddTo(root);
        (from curr in CurrentGamblingLevel
         where curr > NextJackpotLevel.Value
         select curr).Subscribe(delegate(int lvl)
        {
            NextJackpotLevel.SetValueAndForceNotify(Singleton <EconomyHelpers> .Instance.GetNextGamblingJackpotLevel(lvl));
        }).AddTo(root);
        CurrentGamblingLevel.Subscribe(delegate
        {
            root.StartCoroutine(CardSpawnAnimations());
        }).AddTo(root);
        IsJackpotLevel = (from isJP in CurrentGamblingLevel.CombineLatest(NextJackpotLevel, (int lvl, int jp) => lvl == jp)
                          select(isJP)).TakeUntilDestroy(root).ToReadOnlyReactiveProperty();
        m_initialOpening = bind.StartCoroutine(OpenInitialCards());
    }
Exemplo n.º 4
0
    public static void DoAwake()
    {
        Singleton <PropertyManager> .Construct();

        Singleton <PropertyManager> .Instance.AddRootContext(PlayerData.Instance);

        GamblingBindingManager.Construct();
        Singleton <EconomyHelpers> .Construct();

        Singleton <IAPRunner> .Construct();

        Singleton <AdNetworkCachers> .Construct();

        Singleton <IAPItemCollectionRunner> .Construct();

        Singleton <FundRunner> .Construct();

        Singleton <EnableObjectsRunner> .Construct();

        Singleton <NotEnoughGemsRunner> .Construct();

        Singleton <GamblingRunner> .Construct();
    }
Exemplo n.º 5
0
 public static void ReleaseAll()
 {
     SingletonManager.ReleaseAll();
     GamblingBindingManager.Release();
 }
Exemplo n.º 6
0
 public static void Release()
 {
     Instance = null;
 }
Exemplo n.º 7
0
 public static void Construct()
 {
     Instance = GameObject.Find("BindingManager").GetComponent <GamblingBindingManager>();
 }