Exemplo n.º 1
0
 void roleLaterGuideBones()
 {
     if ((guideEndMask & MGGuideManagerState.downToLine) != 0 && (guideMask & MGGuideManagerState.bones) == 0)
     {
         if (roleFront.transform.localScale.y < 0)
         {
             guideMask        |= MGGuideManagerState.bones;
             skillObjc         = roleFrontJumpScript.skillsDart();
             roadblockGCDTimer = 0;
         }
     }
     if ((guideEndMask & MGGuideManagerState.bones) == 0 && (guideMask & MGGuideManagerState.bones) != 0)
     {
         if (skillObjc != null && skillObjc.transform.position.x - roleLater.transform.position.x <= 3f)
         {
             skillObjc = null;
             showButtonAndLabel("bonesButton(Clone)", "基础操作已经学会啦~\r\n我们来试试技能吧!\r\n点击“金钟罩”可弹开障碍");
         }
         if (skillObjc != null)
         {
             roadblockGCDTimer += Time.deltaTime;
             if (roadblockGCDTimer > 0.25f)
             {
                 roadblockGCDTimer = 0;
                 roleFrontJumpScript.skillsDart();
             }
         }
     }
 }
Exemplo n.º 2
0
 void roleLaterGuideDownToLine()
 {
     if ((guideEndMask & MGGuideManagerState.secondJump) != 0 && (guideMask & MGGuideManagerState.downToLine) == 0)
     {
         if (roleLaterJumpScript.isGround)
         {
             MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.jumpFormerEventId, null);
             guideMask         |= MGGuideManagerState.downToLine;
             flag               = false;
             roadblockGCDTimer  = 0;
             roadblockHoldLevel = MGSkillRoadblockInfo.skillHoldLevel;
         }
     }
     if ((guideEndMask & MGGuideManagerState.downToLine) == 0 && (guideMask & MGGuideManagerState.downToLine) != 0)
     {
         if (flag == false && roleFront.rigidbody2D.velocity.y <= 0f && roleFrontJumpScript.isGround == false)
         {
             MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.jumpFormerEventId, null);
             flag = true;
         }
         else if (flag && roleFrontJumpScript.isGround == false && roleFront.rigidbody2D.velocity.y <= 0f && roleFront.transform.position.y >= roleFront.GetComponent <SpriteRenderer>().bounds.size.y + MGGlobalDataCenter.defaultCenter().roadOrignY)
         {
             roadblockGCDTimer += Time.deltaTime;
             if (roadblockGCDTimer > 0.05f)
             {
                 roadblockGCDTimer = 0;
                 skillObjc         = roleFrontJumpScript.skillsDart();
             }
         }
         else if (skillObjc != null && roleFront.transform.position.y < roleFront.GetComponent <SpriteRenderer>().bounds.size.y + MGGlobalDataCenter.defaultCenter().roadOrignY)
         {
             if (roadblockHoldLevel > 0)
             {
                 if (roadblockHoldLevel == MGSkillRoadblockInfo.skillHoldLevel)
                 {
                     roadblockGCDTimer = 0;
                     --roadblockHoldLevel;
                     roleFrontJumpScript.skillsRoadblock();
                 }
                 roadblockGCDTimer += Time.deltaTime;
                 if (roadblockGCDTimer > MGSkillRoadblockInfo.skillGCD)
                 {
                     roadblockGCDTimer = 0;
                     --roadblockHoldLevel;
                     roleFrontJumpScript.skillsRoadblock();
                 }
             }
         }
         if (skillObjc != null && skillObjc.transform.position.x - roleLater.transform.position.x <= 3f)
         {
             skillObjc = null;
             showButtonAndLabel("downButton(Clone)", "明月放了好多技能,点击“下翻”来躲避障碍");
         }
     }
 }
Exemplo n.º 3
0
 void roleLaterGuideBlink()
 {
     if ((guideEndMask & MGGuideManagerState.bones) != 0 && (guideMask & MGGuideManagerState.blink) == 0)
     {
         roadblockGCDTimer += Time.deltaTime;
         if (roadblockGCDTimer + 0.25f > MGSkillBonesInfo.durationTime)
         {
             guideMask |= MGGuideManagerState.blink;
             skillObjc  = roleFrontJumpScript.skillsDart();
             flag       = true;
         }
     }
     if ((guideEndMask & MGGuideManagerState.blink) == 0 && (guideMask & MGGuideManagerState.blink) != 0)
     {
         roadblockGCDTimer += Time.deltaTime;
         if (roadblockGCDTimer >= MGSkillBonesInfo.durationTime + 0.1f && flag)
         {
             flag = false;
             showButtonAndLabel("blinkButton(Clone)", "点击“闪烁”可躲避障碍哦");
         }
     }
 }
Exemplo n.º 4
0
 void roleLaterGuideSecondJump()
 {
     //二段跳引导
     if ((guideEndMask & MGGuideManagerState.jump) != 0 && (guideMask & MGGuideManagerState.secondJump) == 0)
     {
         if (roleLaterJumpScript.isGround)
         {
             guideMask         |= MGGuideManagerState.secondJump;
             roadblockGCDTimer  = 0;
             roadblockHoldLevel = MGSkillRoadblockInfo.skillHoldLevel - 1;
             skillObjc          = roleFrontJumpScript.skillsRoadblock();
         }
     }
     if ((guideEndMask & MGGuideManagerState.secondJump) == 0 && (guideMask & MGGuideManagerState.secondJump) != 0)
     {
         if (roadblockHoldLevel > 0)
         {
             roadblockGCDTimer += Time.deltaTime;
             if (roadblockGCDTimer > MGSkillRoadblockInfo.skillGCD)
             {
                 roadblockGCDTimer = 0;
                 --roadblockHoldLevel;
                 roleFrontJumpScript.skillsRoadblock();
             }
         }
         //Debug.Log("guideJump已经开始");
         if (skillObjc != null && skillObjc.transform.position.x - roleLater.transform.position.x <= 3f)
         {
             //Time.timeScale = 0;
             skillObjc = null;
             showButtonAndLabel("upButton(Clone)", "试试二段跳吧,点击“跳跃”来躲避第一个路障");
         }
         if (flag == true && roleLater.rigidbody2D.velocity.y < -2f && Time.timeScale != 0)
         {
             Debug.Log("second jump");
             showButtonAndLabel("upButton(Clone)", "点击“跳跃”进行二段跳");
         }
     }
 }
Exemplo n.º 5
0
 void roleLaterGuideJump()
 {
     //一段跳引导
     if ((guideMask & MGGuideManagerState.jump) == 0)
     {
         if (roleFrontJumpScript.isGround)
         {
             //GameObject.Find("log").GetComponent<UIInput>().label.text= MGFoundtion.getInternIP();
             guideMask |= MGGuideManagerState.jump;
             skillObjc  = roleFrontJumpScript.skillsDart();
         }
     }
     if ((guideEndMask & MGGuideManagerState.jump) == 0)
     {
         //Debug.Log("guideJump已经开始");
         if (skillObjc != null && skillObjc.transform.position.x - roleLater.transform.position.x <= 3f)
         {
             //Time.timeScale = 0;
             skillObjc = null;
             showButtonAndLabel("upButton(Clone)", "点击“跳跃”可躲避飞镖");
         }
     }
 }
Exemplo n.º 6
0
    public void roleFrontGuideClick()
    {
        if ((guideEndMask & MGGuideManagerState.jump) == 0)
        {
            Time.timeScale = 1;
            MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.jumpFormerEventId, null);
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "upButton(Clone)")
                {
                    uiButton.SetActive(false);
                    break;
                }
            }
            guideEndMask      |= MGGuideManagerState.jump;
            guideLastStepTimer = guideDelayTimer;
        }
        else if ((guideEndMask & MGGuideManagerState.secondJump) == 0)
        {
            Time.timeScale = 1;
            MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.jumpFormerEventId, null);
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "upButton(Clone)")
                {
                    uiButton.SetActive(false);
                    break;
                }
            }
            guideEndMask      |= MGGuideManagerState.secondJump;
            guideLastStepTimer = guideDelayTimer;
        }
        else if ((guideEndMask & MGGuideManagerState.downToLine) == 0)
        {
            Time.timeScale = 1;
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "downButton(Clone)")
                {
                    uiButton.GetComponent <Down>().OnMouseDown();
                    uiButton.SetActive(false);
                    break;
                }
            }
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            guideEndMask      |= MGGuideManagerState.downToLine;
            guideLastStepTimer = guideDelayTimer;
        }
        else if ((guideEndMask & MGGuideManagerState.up) == 0)
        {
            Time.timeScale = 1;
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "downButton(Clone)")
                {
                    uiButton.GetComponent <Down>().OnMouseDown();
                    uiButton.SetActive(false);
                    break;
                }
            }
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            guideEndMask      |= MGGuideManagerState.up;
            guideLastStepTimer = guideDelayTimer;
        }
        else if ((guideEndMask & MGGuideManagerState.dart) == 0)
        {
            Time.timeScale = 1;
            string buttonName = null;
            switch (guideDartStep)
            {
            case 2:
                buttonName = "dartButton(Clone)";
                break;

            case 3:
                buttonName = "downButton(Clone)";
                break;

            case 4:
                buttonName = "dartButton(Clone)";
                break;

            case 5:
                buttonName = "downButton(Clone)";
                break;

            case 6:
                buttonName = "dartButton(Clone)";
                break;

            default:
                break;
            }
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == buttonName)
                {
                    if ((guideDartStep & 1) == 1)
                    {
                        uiButton.GetComponent <Down>().OnMouseDown();
                    }
                    else
                    {
                        uiButton.GetComponent <Dart>().OnMouseDown();
                    }
                    uiButton.SetActive(false);
                    break;
                }
            }
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            if (guideDartStep >= 6)
            {
                guideEndMask      |= MGGuideManagerState.dart;
                guideDartStep      = 1;
                guideLastStepTimer = guideDelayTimer;
            }
            roadblockGCDTimer = 0;
        }
        else if ((guideEndMask & MGGuideManagerState.roadblock) == 0)
        {
            Time.timeScale = 1;
            string buttonName = null;
            switch (guideDartStep)
            {
            case 2:
                buttonName = "roadblockButton(Clone)";
                break;

            case 3:
                buttonName = "downButton(Clone)";
                break;

            case 4:
                buttonName = "downButton(Clone)";
                break;

            default:
                break;
            }
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == buttonName)
                {
                    if (guideDartStep == 2)
                    {
                        roadblockHoldLevel = MGSkillRoadblockInfo.skillHoldLevel - 1;
                        roadblockGCDTimer  = 0;
                        roleFrontJumpScript.skillsRoadblock();
                    }
                    else
                    {
                        uiButton.GetComponent <Down>().OnMouseDown();
                    }
                    uiButton.SetActive(false);
                    break;
                }
            }
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
        }
        else if ((guideEndMask & MGGuideManagerState.sprint) == 0)
        {
            Time.timeScale = 1;
            MGNotificationCenter.defaultCenter().postNotification(SkillActEventEnum.sprint, null);
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            roadblockGCDTimer = 0;
        }
        else if ((guideEndMask & MGGuideManagerState.beatback) == 0)
        {
            Time.timeScale = 1;
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "beatbackButton(Clone)")
                {
                    MGNotificationCenter.defaultCenter().postNotification(SkillActEventEnum.beatback, null);
                    uiButton.SetActive(false);
                    break;
                }
            }
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            guideEndMask      |= MGGuideManagerState.beatback;
            guideLastStepTimer = guideDelayTimer;
        }
        else if (isGuideEnd)
        {
            guideEndClickOper();
        }
        guideLabel.SetActive(false);
        skillObjc = null;
    }
Exemplo n.º 7
0
    public void roleLaterGuideClick()
    {
        if ((guideEndMask & MGGuideManagerState.jump) == 0)
        {
            Time.timeScale = 1;
            MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.jumpLatterEventId, null);
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "upButton(Clone)")
                {
                    uiButton.SetActive(false);
                    break;
                }
            }
            guideEndMask |= MGGuideManagerState.jump;
        }
        else if ((guideEndMask & MGGuideManagerState.secondJump) == 0)
        {
            if (flag == false)
            {
                Time.timeScale = 1;
                MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.jumpLatterEventId, null);
                GameObject.Find("NetWork").GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
                flag = true;
            }
            else if (flag == true)
            {
                Debug.Log("second jump click");
                flag           = false;
                Time.timeScale = 1;
                MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.jumpLatterEventId, null);
                this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
                foreach (GameObject uiButton in UIButtons)
                {
                    if (uiButton.name == "upButton(Clone)")
                    {
                        uiButton.SetActive(false);
                        break;
                    }
                }
                guideEndMask |= MGGuideManagerState.secondJump;
            }
        }
        else if ((guideEndMask & MGGuideManagerState.downToLine) == 0)
        {
            Time.timeScale = 1;
            MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.dowmToLineLatterEventId, null);
            MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.downToLineFormerEventId, null);
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "downButton(Clone)")
                {
                    uiButton.SetActive(false);
                    break;
                }
            }
            guideEndMask |= MGGuideManagerState.downToLine;
        }
        else if ((guideEndMask & MGGuideManagerState.bones) == 0)
        {
            Time.timeScale    = 1;
            roadblockGCDTimer = 0f;
            MGNotificationCenter.defaultCenter().postNotification(SkillActEventEnum.bones, null);
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "bonesButton(Clone)")
                {
                    uiButton.SetActive(false);
                    break;
                }
            }
            guideEndMask |= MGGuideManagerState.bones;
        }
        else if ((guideEndMask & MGGuideManagerState.blink) == 0)
        {
            Time.timeScale = 1;
            roleLaterJumpScript.skillsBlink();
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "blinkButton(Clone)")
                {
                    uiButton.SetActive(false);
                    break;
                }
            }
            guideEndMask     |= MGGuideManagerState.blink;
            roadblockGCDTimer = 0;
        }
        else if ((guideEndMask & MGGuideManagerState.beatback) == 0)
        {
            Time.timeScale = 1;
            roleFrontJumpScript.skillsBeatback();
            roadblockGCDTimer = 0;
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
        }
        else if ((guideEndMask & MGGuideManagerState.sprint) == 0)
        {
            Time.timeScale = 1;
            roleLaterJumpScript.skillsSprint();
            MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.jumpFormerEventId, null);
            MGNotificationCenter.defaultCenter().postNotification(RoleActEventEnum.jumpLatterEventId, null);
            this.GetComponent <MGGuideDarkLayer>().destoryDarkLayer();
            foreach (GameObject uiButton in UIButtons)
            {
                if (uiButton.name == "sprintButton(Clone)")
                {
                    uiButton.SetActive(false);
                    break;
                }
            }

            roadblockGCDTimer = 0;
        }
        else if (isGuideEnd)
        {
            guideEndClickOper();
        }
        guideLabel.SetActive(false);
        skillObjc = null;
    }