예제 #1
0
    /// <summary>播放单个语音</summary>
    private void PlaySound(IListenerTracker listener)
    {
        string name = null;

        name = listener.OnGetCurrentTransform().name.ToLower();
        PlayUnit playUnit = null;

        //获取卡牌类型
        //不是字母的话播放双语
        if (listener.Type != TrackerType.LETTER)
        {
            string pare = null;
            //先去小库(500个单词)里找解释
            if (ContentHelper.Instance.units.ContainsKey(name))
            {
                WordUnit unit = ContentHelper.Instance.units[name];
                pare = unit.Parephrase;
            }
            else//去词典里找解释
            {
                pare = ContentHelper.Instance.GetPare(name);
            }
            playUnit = new Bilingual(name, pare);
        }
        else//只播放声音(非双语)
        {
            playUnit = new SingleTone(name);
        }
        AudioManager.Instance.SetUnits(playUnit);
    }
예제 #2
0
    public void Start()
    {
        SingleTone <UIManager> .Creator();

        SingleTone <ContextManager> .Creator();
    }