Exemplo n.º 1
0
    public void CollectBackClick()
    {
        CollectSceen.SetActive(false);
        if (OriginGameObject != null)
        {
            OriginGameObject.SetActive(true);

            if (CollectSceen.transform.GetChild(CollectSceen.transform.childCount - 1).GetComponentInChildren <List>().HaveRedDot())
            {
                //OriginGameObject.transform.FindChild("Collect").FindChild("RedDot").gameObject.SetActive(true);
                GameOverScreenRedDot.SetActive(true);
                MainScreenRedDot.SetActive(true);
            }
            else
            {
                //OriginGameObject.transform.FindChild("Collect").FindChild("RedDot").gameObject.SetActive(false);
                GameOverScreenRedDot.SetActive(false);
                MainScreenRedDot.SetActive(false);
            }
        }
        CollectSceen.transform.GetChild(CollectSceen.transform.childCount - 1)
        .GetComponentInChildren <List>().ToShrinkAll();

        AudioContorller._Instance.PlayAudioOneTimeNotStopLast(6, 0.8f);
    }
Exemplo n.º 2
0
    public int PlayerCurrentScore; //玩家当前的分数

    void Awake()
    {
        _Instance      = this;
        m_TimeLine     = PlayScreen.GetComponentInChildren <Scrollbar>();
        m_LifeIndicate = PlayScreen.transform.GetChild(PlayScreen.transform.childCount - 1)
                         .GetChild(0).GetComponent <Image>();

        //初始化收集列表item
        List collects = CollectSceen.transform.GetChild(CollectSceen.transform.childCount - 1).GetComponentInChildren <List>();

        if (collects.itemCount == 0)
        {
            collects.InitList(ConstValue.GetInstance().levelStrings.Count);
        }
        m_collects = collects;
        foreach (var item in collects.GetComponentsInChildren <ListElement>())
        {
            if (item.RedDot.activeSelf)
            {
                MainScreenRedDot.SetActive(true);
                GameOverScreenRedDot.SetActive(true);
                break;
            }
        }
        if (PlayerPrefs.GetString("ShowMainCollect") == "true")
        {
            MainScreen.transform.FindChild("Collect").gameObject.SetActive(true);
        }
    }
Exemplo n.º 3
0
 public void ShowRedDot(int index)
 {
     if (PlayerPrefs.GetString("ShowMainCollect") != "true")
     {
         MainScreen.transform.FindChild("Collect").gameObject.SetActive(true);
         PlayerPrefs.SetString("ShowMainCollect", "true");
     }
     MainScreenRedDot.SetActive(true);
     GameOverScreenRedDot.SetActive(true);
     ListElement[] eles = m_collects.GetComponentsInChildren <ListElement>();
     eles[index].ShowRedDot(index);
 }