Ejemplo n.º 1
0
        private void ResetTextPreview()
        {
            if (textPreviewAnimation == null)
            {
                return;
            }
            textPreviewAnimation.Stop();
            textPreview.Clear();
            var entry = textPreview.AddEntry(
                GetPreviewDisplayData(),
                TextAlignmentOptions.TopLeft,
                Color.black,
                Color.black,
                ""
                );
            var contentBox       = entry.contentBox;
            var contentProxy     = entry.contentProxy;
            var textAnimDuration = contentBox.textInfo.characterCount * textSpeed.perCharacterFadeInDuration;

            currentTextPreviewTimeLeft = textAnimDuration + autoDelay;
            textPreviewAnimation.Do(
                new TextFadeInAnimationProperty(contentProxy, 255),
                textAnimDuration
                );
            textPreviewIndex = (textPreviewIndex + 1) % TextPreviewKeys.Length;
        }
        private void ResetTextPreview()
        {
            if (textAnimation == null)
            {
                return;
            }
            textAnimation.Stop();
            dialogueText.Clear();
            var entry = dialogueText.AddEntry(
                GetPreviewDisplayData(),
                TextAlignmentOptions.TopLeft,
                Color.black,
                Color.black,
                null,
                DialogueEntryLayoutSetting.Default,
                0
                );
            var contentProxy = entry.contentProxy;
            var textDuration = perCharacterFadeInDuration * contentProxy.GetPageCharacterCount();

            currentTextPreviewTimeLeft = textDuration + autoDelay;
            textAnimation.Do(
                new TextFadeInAnimationProperty(contentProxy, 255),
                textDuration
                );
            textPreviewIndex = (textPreviewIndex + 1) % TextPreviewKeys.Length;
        }
Ejemplo n.º 3
0
    static int Do(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                Nova.NovaAnimation      obj  = (Nova.NovaAnimation)ToLua.CheckObject <Nova.NovaAnimation>(L, 1);
                Nova.IAnimationProperty arg0 = (Nova.IAnimationProperty)ToLua.CheckObject <Nova.IAnimationProperty>(L, 2);
                Nova.AnimationEntry     o    = obj.Do(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 3)
            {
                Nova.NovaAnimation      obj  = (Nova.NovaAnimation)ToLua.CheckObject <Nova.NovaAnimation>(L, 1);
                Nova.IAnimationProperty arg0 = (Nova.IAnimationProperty)ToLua.CheckObject <Nova.IAnimationProperty>(L, 2);
                float arg1            = (float)LuaDLL.luaL_checknumber(L, 3);
                Nova.AnimationEntry o = obj.Do(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 4)
            {
                Nova.NovaAnimation      obj  = (Nova.NovaAnimation)ToLua.CheckObject <Nova.NovaAnimation>(L, 1);
                Nova.IAnimationProperty arg0 = (Nova.IAnimationProperty)ToLua.CheckObject <Nova.IAnimationProperty>(L, 2);
                float arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                Nova.AnimationEntry.EasingFunction arg2 = (Nova.AnimationEntry.EasingFunction)ToLua.CheckDelegate <Nova.AnimationEntry.EasingFunction>(L, 4);
                Nova.AnimationEntry o = obj.Do(arg0, arg1, arg2);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 5)
            {
                Nova.NovaAnimation      obj  = (Nova.NovaAnimation)ToLua.CheckObject <Nova.NovaAnimation>(L, 1);
                Nova.IAnimationProperty arg0 = (Nova.IAnimationProperty)ToLua.CheckObject <Nova.IAnimationProperty>(L, 2);
                float arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                Nova.AnimationEntry.EasingFunction arg2 = (Nova.AnimationEntry.EasingFunction)ToLua.CheckDelegate <Nova.AnimationEntry.EasingFunction>(L, 4);
                int arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
                Nova.AnimationEntry o = obj.Do(arg0, arg1, arg2, arg3);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Nova.NovaAnimation.Do"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 4
0
        private void SetSpriteRenderer(Sprite value, bool overlay)
        {
            Color color   = spriteRenderer.color;
            var   colorTo = new Color(color.r, color.g, color.b, 0.0f);

            bool needFadeInDelay = false;

            if (spriteRenderer.sprite != null)
            {
                needFadeInDelay              = true;
                ghostSpriteRenderer.sprite   = spriteRenderer.sprite;
                ghostSpriteRenderer.color    = spriteRenderer.color;
                ghostSpriteRenderer.material = spriteRenderer.material;
                ghost.SetActive(true);
                novaAnimation.Do(new OpacityAnimationProperty(ghostSpriteRenderer, color.a, colorTo.a), fadeDuration)
                .Then(new ActionAnimationProperty(() => ghost.SetActive(false)));
            }

            if (value != null)
            {
                spriteRenderer.sprite = value;
                if (!overlay)
                {
                    spriteRenderer.color = colorTo;
                    if (needFadeInDelay)
                    {
                        novaAnimation.Do(null, fadeInDelay)
                        .Then(new OpacityAnimationProperty(spriteRenderer, colorTo.a, color.a), fadeDuration);
                    }
                    else
                    {
                        novaAnimation.Do(new OpacityAnimationProperty(spriteRenderer, colorTo.a, color.a),
                                         fadeDuration);
                    }
                }
            }
            else
            {
                spriteRenderer.sprite = null;
            }
        }