Ejemplo n.º 1
0
    IEnumerator SentenceLogicStream(float duration,
                                    Dictionary <string, RhythmTap> tapDic,
                                    EffectInOutTiming inOut)
    {
        m_CacheTapDic = tapDic;

        yield return(new WaitForSeconds(duration));

        // 得到语句结束判断   语句结束动画
        //foreach (KeyValuePair<string, RhythmTap> kv in tapDic)
        //{
        //	if (kv.Value != null)
        //	{
        //		kv.Value.OnSentenceEnd(CorePlayTempHandler.inputCheckCorrect);
        //	}
        //}

        // 语句渐隐
        //if (tapDic != null)
        //{
        //	foreach (KeyValuePair<string, RhythmTap> kv in tapDic)
        //	{
        //		kv.Value.StartFade();
        //	}
        //}
        //yield return new WaitForSeconds(0.5f);
        if (inOut == EffectInOutTiming.Both || inOut == EffectInOutTiming.DelayOut)
        {
            float delay = 0.001f * CorePlaySettings.Instance.m_PreShowTimeLength;
            yield return(new WaitForSeconds(delay));
            //LogManager.LogWarning("  = 这句话推迟删除啦 " , Time.frameCount , " / " , delay);
        }

        DeleteAll(tapDic);
    }
Ejemplo n.º 2
0
    public RhythmTap CreateWord(CorePlayManager manager, ClickObj clickWord, EffectInOutTiming inOut = EffectInOutTiming.Default, int sentenceIndex = 0)
    {
        RhythmTap tap = new RhythmTap();

        tap.Start(manager, clickWord, inOut, sentenceIndex);
        return(tap);
    }
Ejemplo n.º 3
0
    public void Start(CorePlayManager manager,
                      ClickObj clickWord,
                      EffectInOutTiming inOut,
                      int sentenceIndex)
    {
        IsTutorial      = false;
        m_Manager       = manager;
        m_Clickable     = true;
        m_HitWord       = clickWord.m_Word;
        m_SentenceIndex = sentenceIndex;
        // 创建
        m_ObjectTrans = ObjectPool.GetOne("RhythmController").transform;

        // Set Transform
        Vector3 pos = clickWord.m_Position;

        pos = new Vector3(pos.x / OSU_WIDTH * ScreenWidth - HalfScreenWidth,
                          HalfScreenHeight - pos.y / OSU_HEIGHT * ScreenHeight,
                          0);

        // Set RhythmController
        contrller = m_ObjectTrans.GetComponent <RhythmController>();
        contrller.Init(this,
                       clickWord.m_Word,
                       clickWord.m_ShowWord, pos, inOut);
    }
Ejemplo n.º 4
0
    public void CreateWords(SentenceObj sentenceObj, int sentenceIndex)
    {
        Dictionary <string, RhythmTap> tapDic = new Dictionary <string, RhythmTap>();
        float checkDuration = 0.001f * (sentenceObj.m_InOutTime.EndTime - sentenceObj.m_InOutTime.StartTime + 30);

        EffectInOutTiming inOut = sentenceObj.m_InOutTime.InOut;

        foreach (ClickObj co in sentenceObj.ClickAndHOList.ClickObjs)
        {
            if (!tapDic.ContainsKey(co.m_Word))
            {
                RhythmTap tap = CreateWord(m_Manager, co, inOut, sentenceIndex);
                tapDic.Add(co.m_Word, tap);
                if (co.m_ClickTimes > 1)
                {
                    tap.SetTicWord();
                }
            }
            else
            {
                tapDic[co.m_Word].SetTicWord();
            }
        }
        m_TapDic = tapDic;

        //	LogManager.Log(" 1 计划时间 " , (Time.time + preShowDuration).ToString());
        StaticMonoBehaviour.Instance.StartCoroutine(SentenceLogicStream(checkDuration, tapDic, inOut));
    }
Ejemplo n.º 5
0
    public void Init(RhythmObject tap,
                     string _word,
                     string _ShowWord,
                     Vector3 targetPos,
                     EffectInOutTiming inOut = EffectInOutTiming.Default)
    {
        //print(_word);
        //print(_ShowWord);
        // 存数值
        _tap        = tap;
        first_word  = _word;
        second_word = _ShowWord;

        preShowTime = 0.001f * CorePlaySettings.Instance.m_PreShowTimeLength;

        _SetState(State.Default);

        // 设置文字组建
        text_word.text  = string.Empty;
        text_word.color = Color.white;
        tran_base.gameObject.SetActive(false);

        // 处理提前进场
        if (inOut == EffectInOutTiming.Both || inOut == EffectInOutTiming.AheadIn)
        {
            //LogManager.Log("Go = 处理提前进场");
            WordEnter();
        }
        else
        {
            WordFadeIn();
        }

        transform.localPosition = targetPos;
        coll.enabled            = true;
    }