コード例 #1
0
    private void Update()
    {
        //pause
        if (CrossPlatformInputManager.GetButtonDown("START"))
        {
            pause = !pause;
            co_pause_menu.SetActive(pause);
            //co_act_menu.SetActive(!pause);
            //GetComponent<PauseMenu>().enabled = true;
            if (!pause)
            {
                FairySystem fairy = co_pause_menu.transform.Find("FairySystem").GetComponent <FairySystem>();
                if (fairy.GetEquip() == 0)
                {
                    GetComponent <Status>().SetHPMax(16 + fairy.GetLvA(0));
                }
                else
                {
                    GetComponent <Status>().SetHPMax(16);
                }
                if (fairy.GetEquip() == 1)
                {
                    PlayerPrefs.SetInt("DropHeart", 5 * fairy.GetLvA(1));
                    PlayerPrefs.SetInt("DropCrystal", 5 * fairy.GetLvB(1));
                }
                else
                {
                    PlayerPrefs.SetInt("DropHeart", 0);
                    PlayerPrefs.SetInt("DropCrystal", 0);
                }
            }
            else
            {
                //FairySystem fairy = co_pause_menu.transform.Find("FairySystem").GetComponent<FairySystem>();
                // fairy.CrystalUpdate();
            }
        }
        if (pause)
        {
            Time.timeScale = 0;
        }
        else
        {
            if (change)
            {
                Time.timeScale = 0;

                if (CrossPlatformInputManager.GetButtonDown("up"))
                {
                    m_Character.CostumeChange(1);
                    change_finish = true;
                }
            }
            else
            {
                Time.timeScale = 1;
                if (CrossPlatformInputManager.GetButtonDown("up"))
                {
                    Npc[] npcs = FindObjectsOfType <Npc>() as Npc[];
                    foreach (Npc npc in npcs)
                    {
                        if (npc.CheckIn(GetComponent <ColliderBox>()))
                        {
                            string binid = "NPC" + npc.npcno;
                            EnterAVGMode(binid);
                            break;
                        }
                    }
                }

                if (CrossPlatformInputManager.GetButtonDown("X"))
                {
                    int cos = m_Character.GetCostume();

                    if (cos > 0 && cos < 5)
                    {
                        m_Character.CostumeChange(0);
                        change_finish = true;
                    }
                }

                if (CrossPlatformInputManager.GetButtonDown("Y"))
                {
                    m_Character.Shoot();
                }
                if (CrossPlatformInputManager.GetButtonDown("A"))
                {
                    if (m_Character.GetCrouch())
                    {
                        m_Character.CostumeChange(6);
                    }
                }
                if (!m_Jump)
                {
                    // Read the jump input in Update so button presses aren't missed.
                    m_Jump = CrossPlatformInputManager.GetButtonDown("B");
                }
                if (CrossPlatformInputManager.GetButtonDown("SELECT"))
                {
                    SceneManager.LoadScene("Title");
                }

                if (!b_Jump)
                {
                    b_Jump = CrossPlatformInputManager.GetButtonUp("B");
                }
            }
            //changing check
            if (CrossPlatformInputManager.GetButtonDown("X"))
            {
                guioffset = 0;
            }
            if (CrossPlatformInputManager.GetButton("X"))
            {
                if (CrossPlatformInputManager.GetButton("down"))
                {
                    change_finish = true;
                }
                else if (change_finish)
                {
                    change = false;
                }
                else if (m_Character.GetCostume() < 5)
                {
                    change   = true;
                    guialarm = 0;
                }
            }
            else
            {
                change        = false;
                change_finish = false;
            }

            //damage
            if (b_damage)
            {
                {
                    MeetEnemy(teki);
                }
            }
        }
    }
コード例 #2
0
    private void Update()
    {
        //pause
        if (CrossPlatformInputManager.GetButtonDown("START"))
        {
            pause = !pause;
            co_pause_menu.SetActive(pause);
            co_act_menu.SetActive(!pause);
            //GetComponent<PauseMenu>().enabled = true;
        }
        if (pause)
        {
            Time.timeScale = 0;
        }
        else
        {
            if (change)
            {
                Time.timeScale = 0;

                if (CrossPlatformInputManager.GetButtonDown("up"))
                {
                    m_Character.CostumeChange(1);
                    change_finish = true;
                }
            }
            else
            {
                Time.timeScale = 1;
                if (CrossPlatformInputManager.GetButtonDown("up"))
                {
                    if (m_waitnpc)
                    {
                        string binid = "NPC" + npcplot;
                        EnterAVGMode(binid);
                    }
                }

                if (CrossPlatformInputManager.GetButtonDown("X"))
                {
                    int cos = m_Character.GetCostume();

                    if (cos > 0 && cos < 6)
                    {
                        m_Character.CostumeChange(0);
                        change_finish = true;
                    }
                }

                if (CrossPlatformInputManager.GetButtonDown("Y"))
                {
                    m_Character.Shoot();
                }
                if (CrossPlatformInputManager.GetButtonDown("A"))
                {
                    if (m_Character.GetCrouch())
                    {
                        m_Character.CostumeChange(6);
                    }
                }
                if (!m_Jump)
                {
                    // Read the jump input in Update so button presses aren't missed.
                    m_Jump = CrossPlatformInputManager.GetButtonDown("B");
                }
                if (CrossPlatformInputManager.GetButtonDown("SELECT"))
                {
                    SceneManager.LoadScene("Map");
                }

                if (!b_Jump)
                {
                    b_Jump = CrossPlatformInputManager.GetButtonUp("B");
                }
            }
            //changing check
            if (CrossPlatformInputManager.GetButtonDown("X"))
            {
                guioffset = 0;
            }
            if (CrossPlatformInputManager.GetButton("X"))
            {
                if (CrossPlatformInputManager.GetButton("down"))
                {
                    change_finish = true;
                }
                else if (change_finish)
                {
                    change = false;
                }
                else
                {
                    change   = true;
                    guialarm = 0;
                }
            }
            else
            {
                change        = false;
                change_finish = false;
            }

            //damage
            if (b_damage)
            {
                {
                    MeetEnemy(teki);
                }
            }
        }
    }