Пример #1
0
    void ShowStatusPopup()
    {
        if (!isStatusPopupShow)
        {
            Monster monster = MiniGameController.Instance.getEmotionMonster();
            if (monster != null)
            {
                UIController.Instance.ShowPopup(UIController.Instance.MonsterStatusPopup);
                UIStatusController StatusController = UIController.Instance.MonsterStatusPopup.GetComponent <UIStatusController> ();

                StatusController.init(monster);

                isStatusPopupShow = true;
            }
        }
    }
    void ShowStatusPopup()
    {
        if (!isStatusPopupShow)
        {
//			Monster monster = MiniGameController.Instance.getEmotionMonster ();
            if (monster != null && monster.IsReady && monster.Gage >= monster.GageCost.Length - 1 && monster.MiniGame != MiniGameController.GameType.None)
            {
                bool needToShow = false;
                if (
                    (monster.EmotionType != MonsterEmotionTypes.Happy && monster.EmotionType != MonsterEmotionTypes.NONE)
                    &&
                    (
                        !showenStatusPopup.ContainsKey(monster.MonsterType)
                        ||
                        showenStatusPopup [monster.MonsterType] == false
                    ))
                {
                    needToShow = true;
                }
                else if (monster.EmotionType != MonsterEmotionTypes.Happy && monster.EmotionType != MonsterEmotionTypes.NONE)
                {
                    float r = Random.value;
                    Debug.Log("Random.value: " + r.ToString());
                    if (r <= 0.2f)
                    {
                        needToShow = true;
                    }
                }
                if (needToShow == true)
                {
                    UIController.Instance.MonsterStatusPopup.SetActive(true);
                    UIStatusController StatusController = UIController.Instance.MonsterStatusPopup.GetComponent <UIStatusController> ();
                    StatusController.init(monster);

                    if (showenStatusPopup.ContainsKey(monster.MonsterType))
                    {
                        showenStatusPopup [monster.MonsterType] = true;
                    }
                    else
                    {
                        showenStatusPopup.Add(monster.MonsterType, true);
                    }
                }
            }
        }
        isStatusPopupShow = true;
    }