示例#1
0
    /// <summary>
    /// spriteName은 'mainlobby_achievement_' 형태로 입력.
    /// </summary>
    public static IEnumerator PlaySpriteAnimation(Image _imageObject, string _folderName, string _atlasName, string _spriteName, int _spriteCount, float _animationTime, bool _isLoop = true)
    {
        string resName;
        //밀리세컨드로 변환.
        int time = ( int )(_animationTime * 1000);

        if (_isLoop == true)
        {
            while (_isLoop)
            {
                for (int i = 0; i < _spriteCount; i++)
                {
                    resName             = "";
                    resName             = Utils.CreateStringBuilderStr(new string[] { _spriteName, i.ToString() });
                    _imageObject.sprite = Utils.LoadUIImageResourceFromAtlas(_folderName, _atlasName, resName);
                    _imageObject.SetNativeSize();
                    yield return(YieldReturnManager.waitForSeconds(time / _spriteCount));
                }
            }
        }
        else
        {
            for (int i = 0; i < _spriteCount; i++)
            {
                resName             = "";
                resName             = Utils.CreateStringBuilderStr(new string[] { _spriteName, i.ToString() });
                _imageObject.sprite = Utils.LoadUIImageResourceFromAtlas(_folderName, _atlasName, resName);
                _imageObject.SetNativeSize();
                yield return(YieldReturnManager.waitForSeconds(time / _spriteCount));
            }
        }
    }
    //가챠 데이터 로드
    public IEnumerator LoadGachaData()
    {
        gachaDataDic.Clear();

        TextAsset textAsset = Resources.Load <TextAsset>("Data/GachaData");
        string    gachaData = "";

        if (textAsset != null)
        {
            using (StreamReader streamReader = new StreamReader(new MemoryStream(textAsset.bytes)))
            {
                gachaData = streamReader.ReadToEnd();
                streamReader.Close();
            }
        }

        if (string.IsNullOrEmpty(gachaData))
        {
            yield break;
        }

        List <GachaData> gachaDataList = new List <GachaData>();

        using (StringReader sr = new StringReader(gachaData))
        {
            string readLine;

            while ((readLine = sr.ReadLine()) != null)
            {
                if (!readLine.StartsWith("\t"))
                {
                    string[] word = readLine.Split('\t');
                    gachaDataList.Add(new GachaData(word));
                }
            }
        }

        int nationCount = System.Enum.GetNames(typeof(GirlGlobeEnums.eNation)).Length;

        //1 = 튜토리얼 챕터라 2부터 시작
        for (int i = 2; i < nationCount + 1; i++)
        {
            List <GachaData> tempList = new List <GachaData>();

            for (int j = 0; j < gachaDataList.Count; j++)
            {
                if (i == gachaDataList[j].nation_id)
                {
                    tempList.Add(gachaDataList[j]);
                }
            }

            gachaDataDic.Add(i, tempList);
        }

        yield return(YieldReturnManager.waitForEndOfFrame());
    }
    //의상 세트 클라이언트용 데이터 로드
    public IEnumerator LoadWearSetUIData()
    {
        wearSetUIDataList.Clear();

        for (int i = 0; i < wearSetDataList.Count; i++)
        {
            wearSetUIDataList.Add(new WearSetUIData());
        }

        yield return(YieldReturnManager.waitForEndOfFrame());
    }
示例#4
0
    /// <summary>
    /// Image 오브젝트 알파 애니메이션 - 값 감소
    /// </summary>
    public static IEnumerator DisappearImageAlphaAnimation(Image _imageObject, float _startAlphaValue, float _targetAlphaValue, float _addAlphaValue, int _waitValue)
    {
        float alphaValue = _startAlphaValue;
        Color imageColor = new Color(_imageObject.color.r, _imageObject.color.g, _imageObject.color.b, alphaValue);

        while (_targetAlphaValue < _imageObject.color.a)
        {
            alphaValue        -= _addAlphaValue;
            imageColor.a       = alphaValue;
            _imageObject.color = imageColor;
            yield return(YieldReturnManager.waitForSeconds(_waitValue));
        }
    }
示例#5
0
    /// <summary>
    /// Text 오브젝트 알파 애니메이션 - 값 증가
    /// </summary>
    public static IEnumerator AppearTextAlphaAnimation(Text _textObject, float _startAlphaValue, float _targetAlphaValue, float _addAlphaValue, int _waitValue)
    {
        float alphaValue = _startAlphaValue;
        Color textColor  = new Color(_textObject.color.r, _textObject.color.g, _textObject.color.b, alphaValue);

        while (_textObject.color.a < _targetAlphaValue)
        {
            alphaValue       += _addAlphaValue;
            textColor.a       = alphaValue;
            _textObject.color = textColor;
            yield return(YieldReturnManager.waitForSeconds(_waitValue));
        }
    }
示例#6
0
    protected IEnumerator CoLazyDestroy()
    {
        videoImage.texture = null;
        videoPlayer.clip   = null;
        videoClip          = null;
        Destroy(videoPlayer.gameObject);
        videoPlayer = null;
        yield return(YieldReturnManager.waitForSeconds(100));

        //      if( UIAction.COMMON_VIDEOPLAYER_END != null && UIAction.COMMON_VIDEOPLAYER_END.GetInvocationList().Length > 0 )
        //      {
        //    UIAction.COMMON_VIDEOPLAYER_END();
        //}
    }
示例#7
0
    protected IEnumerator PlayTalkText()
    {
        int index = 0;

        while (index <= talkText.Length)
        {
            text = talkText.Substring(0, index);

            yield return(YieldReturnManager.waitForSeconds(70));

            index++;
        }

        isDisplayComplete = true;
    }
    //언어 데이터 로드
    public IEnumerator LoadLanguageData()
    {
        languageStringDic.Clear();

        TextAsset textAsset    = Resources.Load <TextAsset>("Data/LanguageData");
        string    languageData = "";

        if (textAsset != null)
        {
            using (StreamReader streamReader = new StreamReader(new MemoryStream(textAsset.bytes)))
            {
                languageData = streamReader.ReadToEnd();
                streamReader.Close();
            }
        }

        if (string.IsNullOrEmpty(languageData))
        {
            yield break;
        }

        using (StringReader sr = new StringReader(languageData))
        {
            string readLine;

            while ((readLine = sr.ReadLine()) != null)
            {
                if (!readLine.StartsWith("\t"))
                {
                    string[] word = readLine.Split('\t');
                    string   key  = word[0];
                    string   text = word[( int )ProjectManager.Instance.language];
                    text = text.Replace("/n", "\n");
                    text = text.Trim();

                    if (languageStringDic.ContainsKey(key) == false)
                    {
                        languageStringDic.Add(key, text);
                    }
                }
            }
        }

        yield return(YieldReturnManager.waitForEndOfFrame());
    }
    //챕터 스테이지 데이터 로드
    public IEnumerator LoadChapterStageData()
    {
        chapterStageDataList.Clear();

        TextAsset textAsset        = Resources.Load <TextAsset>("Data/ChapterStageData");
        string    chapterStageData = "";

        if (textAsset != null)
        {
            using (StreamReader streamReader = new StreamReader(new MemoryStream(textAsset.bytes)))
            {
                chapterStageData = streamReader.ReadToEnd();
                streamReader.Close();
            }
        }

        if (string.IsNullOrEmpty(chapterStageData))
        {
            yield break;
        }

        using (StringReader sr = new StringReader(chapterStageData))
        {
            string readLine;

            while ((readLine = sr.ReadLine()) != null)
            {
                if (!readLine.StartsWith("\t"))
                {
                    string[] word = readLine.Split('\t');
                    chapterStageDataList.Add(new ChapterStageData(word));
                }
            }
        }

        yield return(YieldReturnManager.waitForEndOfFrame());
    }