示例#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));
            }
        }
    }
示例#2
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));
        }
    }
示例#3
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));
        }
    }
示例#4
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();
        //}
    }
示例#5
0
    protected IEnumerator PlayTalkText()
    {
        int index = 0;

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

            yield return(YieldReturnManager.waitForSeconds(70));

            index++;
        }

        isDisplayComplete = true;
    }