GetSingleJellyCount() public method

public GetSingleJellyCount ( ) : int
return int
Beispiel #1
0
    public override void OnShow()
    {
        base.OnShow();


        m_collectBoard.gameObject.SetActive(false);
        m_jellyBoard.gameObject.SetActive(false);
        m_scoreBoard.gameObject.SetActive(false);
        m_nutBoard.gameObject.SetActive(false);
        m_gameFailedBoard.gameObject.SetActive(false);
        m_resortBoard.gameObject.SetActive(false);
        m_autoResortBoard.gameObject.SetActive(false);
        m_stepLimitBoard.gameObject.SetActive(false);
        m_timeLimitBoard.gameObject.SetActive(false);
        m_sugarCrushBoard.gameObject.SetActive(false);

        Transform curBoard;

        if (Mode == TargetMode.StageTarget)
        {
            m_background.spriteName = "TargetBar";
            StageData stage = GlobalVars.CurStageData;
            if (stage.Target == GameTarget.GetScore)
            {
                m_scoreBoard.gameObject.SetActive(true);
                curBoard = m_scoreBoard;
                NumberDrawer scoreLabel = UIToolkits.FindComponent <NumberDrawer>(curBoard, "Score");
                scoreLabel.SetNumberRapid(stage.StarScore[0]);
            }
            else if (stage.Target == GameTarget.ClearJelly)
            {
                m_jellyBoard.gameObject.SetActive(true);
                curBoard = m_jellyBoard;



                if (stage.GetDoubleJellyCount() > 0 && stage.GetSingleJellyCount() > 0)
                {
                    m_jellyBoard.LocalPositionX(-30.0f);
                    NumberDrawer jelly2Label = GetChildComponent <NumberDrawer>("Jelly2Count");
                    jelly2Label.SetNumberRapid(stage.GetDoubleJellyCount());
                    NumberDrawer jellyLabel = GetChildComponent <NumberDrawer>("JellyCount");
                    jellyLabel.SetNumberRapid(stage.GetSingleJellyCount());

                    jellySplash.gameObject.SetActive(true);
                    jellyIcon.gameObject.SetActive(true);
                    jellyDoubleIcon.gameObject.SetActive(true);

                    jellyIcon.LocalPositionX(48.0f);
                    jellyDoubleIcon.LocalPositionX(253.2f);
                }
                else if (stage.GetDoubleJellyCount() > 0 && stage.GetSingleJellyCount() == 0)
                {
                    NumberDrawer jelly2Label = GetChildComponent <NumberDrawer>("Jelly2Count");
                    jelly2Label.SetNumberRapid(stage.GetDoubleJellyCount());
                    jellySplash.gameObject.SetActive(false);
                    jellyIcon.gameObject.SetActive(false);
                    jellyDoubleIcon.gameObject.SetActive(true);
                    jellyDoubleIcon.LocalPositionX(48.0f);
                    m_jellyBoard.LocalPositionX(86.0f);
                }
                else
                {
                    NumberDrawer jellyLabel = GetChildComponent <NumberDrawer>("JellyCount");
                    jellyLabel.SetNumberRapid(stage.GetSingleJellyCount());
                    jellySplash.gameObject.SetActive(false);
                    jellyIcon.gameObject.SetActive(true);
                    jellyIcon.LocalPositionX(48.0f);
                    jellyDoubleIcon.gameObject.SetActive(false);
                    m_jellyBoard.LocalPositionX(86.0f);
                }
            }
            else if (stage.Target == GameTarget.BringFruitDown)
            {
                m_nutBoard.gameObject.SetActive(true);
                curBoard = m_nutBoard;

                if (stage.Nut1Count > 0)
                {
                    nut1Label.SetNumberRapid(stage.Nut1Count);

                    nut1Label.gameObject.SetActive(true);
                    nut1Icon.gameObject.SetActive(true);
                    nut1Label.LocalPositionX(-14);
                }
                else
                {
                    nut1Label.gameObject.SetActive(false);
                    nut1Icon.gameObject.SetActive(false);
                }

                if (stage.Nut2Count > 0)
                {
                    nut2Label.SetNumberRapid(stage.Nut2Count);

                    nut2Label.gameObject.SetActive(true);
                    nut2Icon.gameObject.SetActive(true);
                    nut2Label.LocalPositionX(-14);
                }
                else
                {
                    nut2Label.gameObject.SetActive(false);
                    nut2Icon.gameObject.SetActive(false);
                }

                if (stage.Nut1Count > 0 && stage.Nut2Count > 0)
                {
                    nutSplash.gameObject.SetActive(true);

                    nut1Label.LocalPositionX(-101);
                    nut2Label.LocalPositionX(71);
                }
                else
                {
                    nutSplash.gameObject.SetActive(false);
                }
            }
            else                //Collect
            {
                m_collectBoard.gameObject.SetActive(true);
                curBoard = m_collectBoard;
                int collectCount = 0;

                for (int i = 0; i < 3; ++i)
                {
                    if (stage.CollectCount[i] > 0)
                    {
                        ++collectCount;
                        collectLabel[i].gameObject.SetActive(true);
                        collectIcon[i].gameObject.SetActive(true);

                        collectLabel[i].text = stage.CollectCount[i].ToString();

                        switch (GlobalVars.CurStageData.CollectSpecial[i])
                        {
                        case TSpecialBlock.ESpecial_Normal:
                        {
                            collectIcon[i].spriteName = "Item" + (int)(GlobalVars.CurStageData.CollectColors[i] - TBlockColor.EColor_None);
                        }
                        break;

                        case TSpecialBlock.ESpecial_NormalPlus6:
                        {
                            collectIcon[i].spriteName = "TimeAdded" + (int)(GlobalVars.CurStageData.CollectColors[i] - TBlockColor.EColor_None);
                        }
                        break;

                        case TSpecialBlock.ESpecial_EatLineDir0:
                            collectIcon[i].spriteName = "Line" + (int)(GlobalVars.CurStageData.CollectColors[i] - TBlockColor.EColor_None) + "_3";
                            break;

                        case TSpecialBlock.ESpecial_EatLineDir1:
                            collectIcon[i].spriteName = "Line" + (int)(GlobalVars.CurStageData.CollectColors[i] - TBlockColor.EColor_None) + "_1";
                            break;

                        case TSpecialBlock.ESpecial_EatLineDir2:
                            collectIcon[i].spriteName = "Line" + (int)(GlobalVars.CurStageData.CollectColors[i] - TBlockColor.EColor_None) + "_2";
                            break;

                        case TSpecialBlock.ESpecial_Bomb:
                            collectIcon[i].spriteName = "Bomb" + (int)(GlobalVars.CurStageData.CollectColors[i] - TBlockColor.EColor_None);
                            break;

                        case TSpecialBlock.ESpecial_EatAColor:
                            collectIcon[i].spriteName = "Rainbow";
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        collectLabel[i].gameObject.SetActive(false);
                        collectIcon[i].gameObject.SetActive(false);
                    }
                }

                if (collectCount == 3)
                {
                    m_collectBoard.LocalPositionX(0);
                }
                else if (collectCount == 2)
                {
                    m_collectBoard.LocalPositionX(67);
                }
                else
                {
                    m_collectBoard.LocalPositionX(120);
                }
            }

            if (stage.StepLimit > 0)
            {
                m_stepLimitBoard.gameObject.SetActive(true);
                NumberDrawer stepLabel = UIToolkits.FindComponent <NumberDrawer>(m_stepLimitBoard, "StepNum");
                stepLabel.SetNumberRapid(stage.StepLimit);
            }
            else
            {
                m_timeLimitBoard.gameObject.SetActive(true);
                NumberDrawer timeLabel = UIToolkits.FindComponent <NumberDrawer>(m_timeLimitBoard, "TimeNum");
                timeLabel.SetNumberRapid(stage.TimeLimit);
            }
        }
        else
        {
            if (Mode == TargetMode.GameFailed)
            {
                m_background.spriteName = "FailedBar";
                m_gameFailedBoard.gameObject.SetActive(true);
            }
            else if (Mode == TargetMode.AutoResort)
            {
                m_background.spriteName = "ResortBar";
                m_autoResortBoard.gameObject.SetActive(true);
            }
            else if (Mode == TargetMode.SugarCrush)
            {
                m_background.spriteName = "TargetBar";
                m_sugarCrushBoard.gameObject.SetActive(true);
            }
        }
    }