Esempio n. 1
0
    public void ShowStringPanel(string key)
    {
        selectedPanel = Panel.StringPanel;
        selectedData  = key;

        StringPanel.SetActive(true);
        NumberPanel.SetActive(false);
        TitlePanel.SetActive(false);

        AskButton.SetActive(true);
        InstructionText.SetActive(false);
    }
Esempio n. 2
0
    public void OpenPanel()
    {
        //If the only child is "Title", make sure to instantiate the data fields
        if (DecisionCard.transform.childCount <= 1)
        {
            InitDecisionPanel(FindObjectOfType <GameManager>().ChosenCards[0]);
        }

        StringPanel.SetActive(false);
        NumberPanel.SetActive(false);
        TitlePanel.SetActive(false);

        AskButton.SetActive(false);
        InstructionText.SetActive(true);

        DecisionPanel.SetActive(true);
        DecisionResponse.SetActive(false);
    }
Esempio n. 3
0
    void Update()
    {
        if (TitlePanel.activeSelf)                // 타이틀 화면이 보이는 상태이면
        {
            if (Input.GetMouseButtonUp(0))        // 아무키나 눌렀을때
            {
                Manager.SendMessage("StartGame"); // BlockManager로 StartGame을 호출해 최초 블럭을 생성시킨다.
                TitlePanel.SetActive(false);      // 타이틀 화면을 보이지 않게 한다.
                JoypadPanel.SetActive(true);      // 조이패드를 나타나게 한다.
            }
        }
        else
        {
            // 바다를 고양이의 X,Z 위치로 고정시킨다. Y축은 제외
            Sea.transform.position = new Vector3(transform.position.x, Sea.transform.position.y, transform.position.z);

            if (transform.position.y < 0f)   // 고양이가 0f 이하로 내려가는 경우 (물속에 빠짐)
            {
                if (!WaterEffect.activeSelf) // 물보라 이펙트가 안보이는 상태이면
                {
                    GameOver();
                    audio.clip = CatDie;                                                                             // 고양이가 죽을때 소리
                    audio.Play();
                    LeanTween.rotateAroundLocal(gameObject, Vector3.left, 90f, 0.5f);                                // 고양이를 0.5초간 앞으로 90도 회전시켜 머리부터 빠지게 한다.
                    WaterEffect.SetActive(true);                                                                     // 물보라 이펙트를 활성화시킨다.
                    WaterEffect.transform.position = new Vector3(transform.position.x, -0.5f, transform.position.z); // 물보라 이펙트를 고양이 위치로 옮긴다.
                    Invoke("Restart", 3.0f);                                                                         // 3초후에 게임을 다시 로딩한다.
                    isDead = true;                                                                                   // 고양이가 죽었기 때문에 키입력 등을 금지한다.
                }
            }
            // 윈도우 버전을 위한 키보드 입력에 따른 호출 (Canvas의 조이패드에서도 각각 이 함수들을 호출한다)
            if (Input.GetKeyDown(KeyCode.UpArrow))
            {
                Front();
            }
            if (Input.GetKeyDown(KeyCode.DownArrow))
            {
                Back();
            }
            if (Input.GetKeyDown(KeyCode.LeftArrow))
            {
                Left();
            }
            if (Input.GetKeyDown(KeyCode.RightArrow))
            {
                Right();
            }

            if (!isDead && Manager.CatLandedBlock != null) // 고양이가 살아있고 어딘가에 착지한 상태이면
            {
                if (KeyArray.Count > 0)                    // 키 입력이 1개라도 있는 경우
                {
                    KeyCode key = (KeyCode)KeyArray[0];    // 가장 먼저 입력했던 키 값을 가져온다.

                    // 키 값에 따라 실제로 고양이를 이동시키는 부분
                    if (key == KeyCode.UpArrow)
                    {
                        FrontMove();
                    }
                    if (key == KeyCode.DownArrow)
                    {
                        BackMove();
                    }
                    if (key == KeyCode.LeftArrow)
                    {
                        LeftMove();
                    }
                    if (key == KeyCode.RightArrow)
                    {
                        RightMove();
                    }

                    KeyArray.RemoveAt(0); // 처리한 키 값을 리스트에서 삭제한다.
                }
            }
        }
        if (Input.GetKey(KeyCode.Escape))
        {
            Application.Quit();
        }
    }
Esempio n. 4
0
        public void Selected(int index, string title, List <BeatmapInfo>[] St5, List <BeatmapInfo>[] Th2, List <BeatmapInfo>[] Th4, List <BeatmapInfo>[] Th6, List <BeatmapInfo>[] Pt1, bool[] filled, int bgaFrame, string bgaPath, string backPath)
        {
            Starlight5 = St5;
            Theater2   = Th2;
            Theater4   = Th4;
            Theater6   = Th6;
            Platinum1  = Pt1;
            CurBGAVal  = bgaFrame;
            BGAPath    = bgaPath;
            BackPath   = backPath;

            titleText.text  = title;
            artistText.text = null;
            authorText.text = null;
            for (int i = 0; i < 5; i++)
            {
                ModeBtn[i].interactable = false;
                ModeBtn[i].gameObject.GetComponent <Image>().color          = Color.white;
                ModeBtn[i].gameObject.GetComponentInChildren <Text>().color = Color.black;
                if (filled[i])
                {
                    ModeBtn[i].interactable = true;
                }
            }
            for (int i = 0; i < 4; i++)
            {
                LevelBtn[i].interactable = false;
                LevelBtn[i].gameObject.GetComponent <Image>().color          = GlobalTheme.ThemeColor();
                LevelBtn[i].gameObject.GetComponentInChildren <Text>().color = GlobalTheme.ThemeContrastColor();
            }
            animationObj.Play("SelectSong_SongSelected", 0, 0);
            if (!TitlePanel.activeSelf)
            {
                TitlePanel.SetActive(true);
            }
            if (!PeoplePanel.activeSelf)
            {
                PeoplePanel.SetActive(true);
            }
            if (!ModePanel.activeSelf)
            {
                ModePanel.SetActive(true);
            }

            if (!SongSelectedPrevious)
            {
                OptionPanel.SetActive(true);
                SongSelectedPrevious = true;
            }
            LevelSelectedPrevious = false;
            if (BeatmapIndexPanel.activeSelf)
            {
                BeatmapIndexPanel.SetActive(false);
            }

            if (lastButtonIdx != -1)
            {
                buttons[lastButtonIdx].GetComponent <Graphic>().color = GlobalTheme.ThemeColor();
                buttons[lastButtonIdx].GetComponent <SongButton>().buttonText.color = GlobalTheme.ThemeContrastColor();
            }
            lastButtonIdx = index;
        }