コード例 #1
0
    public override void InitData()
    {
        if (BOL_Main_Controller.instance.ChairPosition == Constant.CHAIR_PLAYER || BOL_Main_Controller.instance.ChairPosition == Constant.CHAIR_VIEWER)
        {
            SetActivePanel(false);
        }
        else
        {
            SetActivePanel(true, skillpostion, spellposition);
        }

        canvasShowHero.worldCamera = BOL_Manager.instance.mainCamera.mainCamera;
        _listAction = new List <Action>();
        //OnPressInScene();
        //StartCoroutine(DelayPlaySkillFirstData());


        //DelaySkillWhenPress(timedelayAttack_Q, textAttackQ, _buttonQ, imgDelayQ);
        //DelaySkillWhenPress(timedelayAttack_W, textAttackW, _buttonW, imgDelayW);
        //DelaySkillWhenPress(timedelayAttack_E, textAttackE, _buttonE, imgDelayE);
        //DelaySkillWhenPress(timedelayAttack_Spell, textAttackSpell, _buttonSpell, imgDelaySpell);
        BOL_Manager.instance.StartControlMatrix();
        BOL_Manager.instance.StartCurrentMatrix();
#if TEST
        Debug.Log(Debugs.ColorString("start delay spell", Color.red));
#endif
        if (enumeratorQ != null)
        {
            StopCoroutine(enumeratorQ);
            enumeratorQ = null;
        }
        if (enumeratorW != null)
        {
            StopCoroutine(enumeratorW);
            enumeratorW = null;
        }
        if (enumeratorE != null)
        {
            StopCoroutine(enumeratorE);
            enumeratorE = null;
        }
        if (enumeratorSpell != null)
        {
            StopCoroutine(enumeratorSpell);
            enumeratorSpell = null;
        }
        enumeratorE     = btnSkillE.DelaySkill();
        enumeratorW     = btnSkillW.DelaySkill();
        enumeratorQ     = btnSkillQ.DelaySkill();
        enumeratorSpell = btnSkillSpell.DelaySkill();
        StartCoroutine(enumeratorQ);
        StartCoroutine(enumeratorW);
        StartCoroutine(enumeratorE);
        StartCoroutine(enumeratorSpell);
        OnclickButton();
        Hide();
        StartDelaySkill();
        leftPositionEffect  = _Hero_left_ControlSkill.ParentBody.transform.position;
        rightPositionEffect = _Hero_right_ControlSkill.ParentBody.transform.position;
    }
コード例 #2
0
    IEnumerator AddProcesAction(Action action, string nameAction = "")
    {
#if TEST
        Debug.Log(nameAction + Debugs.ColorString("   is running", Color.red));
#endif
        action();
        yield break;
    }
コード例 #3
0
    public void ResetFinishGame()
    {
#if TEST
        Debug.LogWarning(Debugs.ColorString("ResetFinishGame", Color.red));
#endif

        if (objecFinish != null)
        {
            DespawnGameObject(objecFinish);
            objecFinish = null;
        }
    }
コード例 #4
0
    public void ResetBattle()
    {
#if TEST
        Debug.LogWarning(Debugs.ColorString("ResetBattle", Color.red));
#endif
        Destroy(panelplayerLeft);
        Destroy(panelplayerRight);
        panelplayerLeft   = null;
        panelplayerRight  = null;
        _panelplayerLeft  = null;
        _panelplayerRight = null;
    }
コード例 #5
0
    void ActionFinish(StateScene state)
    {
        switch (state)
        {
        case StateScene.win: break;

        case StateScene.lose: break;

        case StateScene.tie: break;

        default:
#if TEST
            Debug.Log(Debugs.ColorString("không show cái gì cả", Color.red));
#endif
            break;
        }
    }
コード例 #6
0
    public override void InitData()
    {
#if TEST
        Debug.Log(Debugs.ColorString("init data choice hero", Color.red));
#endif
        ins = this;
        //btnStandupLeft.gameObject.SetActive(false);
        //btnStandupRight.gameObject.SetActive(false);
        btnChoiceChairLeft.isChoiceChair  = false;
        btnChoiceChairRight.isChoiceChair = false;
        btnChoiceChairLeft.btnStandUp.gameObject.SetActive(false);
        btnChoiceChairRight.btnStandUp.gameObject.SetActive(false);

        canvasHeroChoice.worldCamera = BOL_Manager.instance.mainCamera.mainCamera;
        listProcessAction            = new List <IEnumerator>();
        StartCoroutine(StartActionStandDown());
#if UNITY_ANDROID
        tableChoiceRect.localScale = Vector3.one * ((0.8f / 2.81203f) * BOL_Manager.instance.mainCamera.mainCamera.orthographicSize);
        //TableChoice.GetComponent<RectTransform>().localScale = Vector3.one * ((0.8f / 2.81203f) * BOL_Manager.instance.MainCam.orthographicSize);
#endif
#if UNITY_IOS
        tableChoiceRect.localScale = Vector3.one * 0.8f;
        //TableChoice.GetComponent<RectTransform>().localScale = Vector3.one * 0.8f;
#endif
        vector_tablechoice = TableChoice.transform.localScale;
        TableChoice.SetActive(false);
        betInGame.text = BOL_Manager.instance.bol_Table_Info.bet.ToString();
        ChoiceChairPosition();
        betInGame.onEndEdit.AddListener(SetBetInGame);
        ReceiveReadyGame(false);
        btnStartGame.onClick.AddListener(() =>
        {
            if (BOL_Manager.instance.CanPlayMusicAndSfx())
            {
                MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);
            }
            if (btnStartGame.transform.GetChild(0).gameObject.activeSelf)
            {
                SetReadyGame(true);
            }
            else
            {
                SetReadyGame(false);
            }
        });
    }
コード例 #7
0
    public void ResetChoiceHero(bool isDetroy = false)
    {
#if TEST
        Debug.LogWarning(Debugs.ColorString("ResetChoiceHero", Color.red));
#endif

        if (isDetroy)
        {
            Destroy(_mainChoice);
            _mainChoice    = null;
            bOL_ChoiceHero = null;
            _myCVChoiceHero.ClearAllObjectsNow();
        }
        else
        {
            bOL_ChoiceHero.ResetData();
        }
    }
コード例 #8
0
    public override void RefreshAgainWhenCloseSubGamePlay()
    {
#if TEST
        Debug.Log(Debugs.ColorString("dong sub game", Color.red));
#endif

        if (CoreGameManager.instance.currentSubGamePlay != null)
        {
            CoreGameManager.instance.currentSubGamePlay = null;
        }

        MyAudioManager.instance.PlayMusic(myAudioInfo.bgm);

        BOL_Main_Controller.instance.panelUserInfo.RefreshGoldInfo(true);
        NetworkGlobal.instance.SetProcessRealTime(CMD_REALTIME.S_onPlayerAddGold, BolNetworkReceiving.instance.S_onPlayerAddGold);
        NetworkGlobal.instance.SetProcessRealTime(CMD_REALTIME.S_GAMEPLAY_SET_PARENT, BolNetworkReceiving.instance.S_PlayerSetParent);
        BolNetworkReceiving.instance.RegisterActionAlertUpdateServer();
    }
コード例 #9
0
    // show hero and button skill;
    public void InitDataShowHeroAndButton()
    {
#if TEST
        Debug.LogWarning(Debugs.ColorString("InitDataShowHeroAndButton", Color.red));
#endif
        if (_showHeroAndButton == null)
        {
            _showHeroAndButton       = SpawnShowHero();;
            bOL_PlaySkill_Controller = _showHeroAndButton.GetComponent <BOL_PlaySkill_Controller>();
            bOL_PlaySkill_Controller.InitData();
        }
        //else {
        //  bOL_PlaySkill_Controller = _showHeroAndButton.GetComponent<BOL_PlaySkill_Controller>();
        //  bOL_PlaySkill_Controller.Initdata();
        //}
        chairLeft  = GameObject.FindWithTag("PlayerLeft");
        chairRight = GameObject.FindWithTag("PlayerRight");
        bOL_PlaySkill_Controller.SetActivePanel(false);
    }
コード例 #10
0
    IEnumerator ProcessAction_right()
    {
        while (true)
        {
            if (!canShowScene)
            {
                yield return(null);

                continue;
            }
#if TEST
            Debug.Log(Debugs.ColorString("Right   đang có ", Color.red) + listProcess_right.Count + Debugs.ColorString("   process chuẩn bị chạy", Color.red));
#endif
            yield return(new WaitUntil(() => listProcess_right.Count > 0));

            yield return(StartCoroutine(listProcess_right[0]));

            listProcess_right.RemoveAt(0);
        }
    }
コード例 #11
0
    // show matrix battle
    public void InitDataBattle()
    {
#if TEST
        Debug.LogWarning(Debugs.ColorString("InitDataBattle", Color.red));
#endif

        listBattle = new MySimplePoolManager();
        float ratio = 1.4f / 2.81203f;
        Debugs.LogRed("init battle");
        panelplayerLeft  = SpawnHeroBattle(Constant.CHAIR_LEFT);
        _panelplayerLeft = panelplayerLeft.GetComponent <BOL_Battle_PlayerInGame>();
        //_panelplayerLeft.InitFirstData(1);
        Piece_Control pieceleft = _panelplayerLeft.GetComponent <Piece_Control>();
        panelplayerRight  = SpawnHeroBattle(Constant.CHAIR_RIGHT);
        _panelplayerRight = panelplayerRight.GetComponent <BOL_Battle_PlayerInGame>();
        //_panelplayerRight.InitFirstData(-1);
        Piece_Control pieceRight = _panelplayerRight.GetComponent <Piece_Control>();
        listBattle.AddObject(pieceleft);
        listBattle.AddObject(pieceRight);
        ResetChoiceHero(true);
    }
コード例 #12
0
    // show finish
    public void InitDataFInish(int styleFinishGame)
    {
#if TEST
        Debug.LogWarning(Debugs.ColorString("InitDataFInish", Color.red));
#endif

        if (styleFinishGame != Constant.CHAIR_VIEWER)
        {
            objecFinish = SpawnFinishGame(styleFinishGame);
            SetupFinishGame(objecFinish);
        }
        Delay(3, () => {
            ResetFinishGame();
            ResetBattle();
            Delay(1, () => {
                InitDataShowHeroAndButton();
                //BOL_Main_Controller.instance.SpawnHeroWhenChoice(chairId, characterid);
                //BOL_Main_Controller.instance.SpawnHeroWhenChoice(chairId, characterid);
                //InitDataShowPlayer();
            });
        });
    }
コード例 #13
0
    // show panel choice hero
    public void InitDataChoice()
    {
#if TEST
        Debug.LogWarning(Debugs.ColorString("InitDataChoice", Color.red));
#endif

        if (_mainChoice == null)
        {
            _mainChoice    = SpawnMainChoice();
            bOL_ChoiceHero = _mainChoice.GetComponent <BOL_ChoiceHero>();
        }
        else
        {
            bOL_ChoiceHero = _mainChoice.GetComponent <BOL_ChoiceHero>();
        }
        Piece_Control piece = _mainChoice.GetComponent <Piece_Control>();
        _myCVChoiceHero.AddObject(piece);
        bOL_ChoiceHero.InitData();
        bOL_ChoiceHero.ResetData();
        if (panelplayerLeft != null)
        {
            DespawnGameObject(panelplayerLeft);
            _panelplayerLeft = null;
        }
        if (panelplayerRight != null)
        {
            DespawnGameObject(panelplayerRight);
            _panelplayerRight = null;
        }
        if (_objectShowPlayer == null)
        {
            bOL_ChoiceHero.SetActiveChoiceHero(true);
        }
        else
        {
            bOL_ChoiceHero.SetActiveChoiceHero(false);
        }
    }
コード例 #14
0
    IEnumerator ProcessCurrentRight()
    {
        while (true)
        {
            if (!canShowScene)
            {
                yield return(null);

                continue;
            }
#if TEST
            Debug.Log(Debugs.ColorString("currentRight ", Color.red) + listCurrent_right.Count + Debugs.ColorString("   process chuẩn bị chạy", Color.red));
#endif
            yield return(new WaitUntil(() => listCurrent_right.Count > 0));

            yield return(StartCoroutine(listCurrent_right[0]));

            listCurrent_right.RemoveAt(0);
#if TEST
            Debug.Log(Debugs.ColorString("Left   còn lại ", Color.red) + listCurrent_right.Count + Debugs.ColorString("  process đang chờ", Color.red));
#endif
        }
    }
コード例 #15
0
    public void SendDATA(List <HeroInfomation> listhero, System.Action <MessageReceiving, int> _onFinished)
    {
        if (CoreGameManager.instance.giaLapNgatKetNoi)
        {
            if (_onFinished != null)
            {
                _onFinished(null, 1);
            }
            return;
        }
        if (CoreGameManager.instance.giaLapMangChapChon)
        {
            if (Random.Range(0, 100) < CoreGameManager.instance.giaLapTyLeRotMang)
            {
                if (_onFinished != null)
                {
                    _onFinished(null, 1);
                }
                return;
            }
        }
        if (SetDataInfo == null)
        {
            SetDataInfo = new MessageSending(CMD_ONEHIT.TEST_SETUP_BOL);
        }
        else
        {
            SetDataInfo.ClearData();
        }
        Debug.Log("read " + listhero.Count);
        for (int i = 0; i < listhero.Count; i++)
        {
            SetDataInfo.writeshort(listhero[i].damgeAttack1);      //damge1
            SetDataInfo.writeshort(listhero[i].damgeAttack2);      //damge2
            SetDataInfo.writeshort(listhero[i].max_hp);            //maxHp
            SetDataInfo.writeshort(listhero[i].max_mana);          //maxMana
            SetDataInfo.writeshort(listhero[i].max_shield);        //maxShield
            SetDataInfo.writeshort(listhero[i].manaOfSkill1);      //manaofskill1
            SetDataInfo.writeshort(listhero[i].manaOfSkill2);      //manaofskill2
            SetDataInfo.writeshort(listhero[i].manaOfUltimate);    //manaofultimate
            SetDataInfo.writeshort(listhero[i].delayOfSkill1);     //delayskill1
            SetDataInfo.writeshort(listhero[i].delayOfSkill2);     //delayskill2
            SetDataInfo.writeshort(listhero[i].delayOfUltimate);   //delayultimate
            Debug.Log(
                listhero[i].damgeAttack1 + "|" +
                listhero[i].damgeAttack2 + "|" +
                listhero[i].max_hp + "|" +
                listhero[i].max_mana + "|" +
                listhero[i].max_shield + "|" +
                listhero[i].manaOfSkill1 + "|" +
                listhero[i].manaOfSkill2 + "|" +
                listhero[i].manaOfUltimate + "|" +
                listhero[i].delayOfSkill1 + "|" +
                listhero[i].delayOfSkill2 + "|" +
                listhero[i].delayOfUltimate
                );
        }
#if TEST
        Debug.Log(">>>CMD Register : " + SetDataInfo.getCMD());
        Debug.Log(Debugs.ColorString("Send Sucessfull", Color.red));
#endif
        NetworkGlobal.instance.StartOnehit(SetDataInfo, _onFinished);
    }
コード例 #16
0
    public void ActionFinish(StateScene state, Action action = null)
    {
        isInitSuccess = false;
        _BOL_ShowHeroAndSkill.Hide();
        panelUserInfo.RefreshGoldInfo(true);
        panelUserInfo.Show();
#if TEST
        Debug.Log("ChairPosition " + ChairPosition);
#endif
        if (ChairPosition == Constant.CHAIR_LEFT || ChairPosition == Constant.CHAIR_RIGHT)
        {
            switch (state)
            {
            case StateScene.win:
                if (_BOL_ShowFinishWin == null)
                {
#if TEST
                    Debug.Log("show win");
#endif
                    _BOL_ShowFinishWin = listStateScene.BOL_ShowFinishWin;
                    Delay(5, () =>
                    {
                        _BOL_ShowFinishWin.ResetData();
                        _BOL_ShowFinishWin.SelfDestruction();
                        _BOL_ShowFinishWin = null;
                        if (ChairPosition != Constant.CHAIR_PLAYER && ChairPosition != Constant.CHAIR_VIEWER)
                        {
                            BOL_PlaySkill_Controller.instance.isStartGame = false;
                        }
                    });
                    StartInitData(InitDataWaiting, () =>
                    {
                        ActionWaiting(StateScene.choiceherofinishgame);
                        int mySessionid = DataManager.instance.userData.sessionId;
                        if (mySessionid == BOL_ShowPlayer_Manager.instance.listUserPlayGame[0].sessionId)
                        {
                            //BOL_ChoiceHero.instance.SetActiveImageChoice(Constant.CHAIR_LEFT, false, true);
                            BOL_ChoiceHero.instance.btnChoiceChairLeft.isChoiceChair = true;
                            BOL_ChoiceHero.instance.Show();
                        }
                        else if (mySessionid == BOL_ShowPlayer_Manager.instance.listUserPlayGame[1].sessionId)
                        {
                            BOL_ChoiceHero.instance.btnChoiceChairRight.isChoiceChair = true;
                            //BOL_ChoiceHero.instance.SetActiveImageChoice(Constant.CHAIR_RIGHT, false, true);
                            BOL_ChoiceHero.instance.Show();
                        }
                    });
                }
                break;

            case StateScene.lose:
                if (_BOL_ShowFinishLose == null)
                {
                    _BOL_ShowFinishLose = listStateScene.BOL_ShowFinishLose;
                    Delay(5, () =>
                    {
                        _BOL_ShowFinishLose.ResetData();
                        _BOL_ShowFinishLose.SelfDestruction();
                        _BOL_ShowFinishLose = null;
                        if (ChairPosition != Constant.CHAIR_PLAYER && ChairPosition != Constant.CHAIR_VIEWER)
                        {
                            BOL_PlaySkill_Controller.instance.isStartGame = false;
                        }
                    });
                    StartInitData(InitDataWaiting, () =>
                    {
                        ActionWaiting(StateScene.choiceherofinishgame);
                        int mySessionid = DataManager.instance.userData.sessionId;
                        if (mySessionid == BOL_ShowPlayer_Manager.instance.listUserPlayGame[0].sessionId)
                        {
                            //BOL_ChoiceHero.instance.SetActiveImageChoice(Constant.CHAIR_LEFT, false, true);
                            BOL_ChoiceHero.instance.btnChoiceChairLeft.isChoiceChair = true;
                            BOL_ChoiceHero.instance.Show();
                        }
                        else if (mySessionid == BOL_ShowPlayer_Manager.instance.listUserPlayGame[1].sessionId)
                        {
                            //BOL_ChoiceHero.instance.SetActiveImageChoice(Constant.CHAIR_RIGHT, false, true);
                            BOL_ChoiceHero.instance.btnChoiceChairRight.isChoiceChair = true;
                            BOL_ChoiceHero.instance.Show();
                        }
                    });
                }
                break;

            case StateScene.tie:
                break;

            case StateScene.viewer:
                break;

            default:
#if TEST
                Debug.Log(Debugs.ColorString("không show cái gì cả", Color.red));
#endif
                break;
            }
        }
        else
        {
            //if (tweenScale != null) {
            //	LeanTween.cancel(imageVS.gameObject, tweenScale.uniqueId);
            //	tweenScale = null;
            //}
            //tweenScale = LeanTween.scale(imageVS.gameObject, Vector3.one, 0.5f).setOnComplete(() => {
            //	tweenScale = null;
            //}).setEase(LeanTweenType.easeOutBack);
        }
    }