Пример #1
0
    private static int DOFade(ILuaState lua)
    {
        GameObject go    = lua.ToGameObject(1);
        var        group = lua.ToEnumValue(2, typeof(FadeGroup));
        var        func  = lua.ToLuaFunction(3);
        bool       reset = lua.OptBoolean(4, false);

        if (go)
        {
            ZTween.Stop(go);
            var tw = group != null?FadeTool.DOFade(go, (FadeGroup)group, reset) : FadeTool.DOFade(go, reset);

            if (func != null)
            {
                if (tw != null)
                {
                    tw.CompleteWith((o) => { func.Invoke(go); func.Dispose(); });
                }
                else
                {
                    LuaScriptMgr.Instance.StartCoroutine(LibUnity.LuaInvoke(func, null, go));
                }
            }
        }
        return(0);
    }
Пример #2
0
    IEnumerator StartIntro()
    {
        pageCount = 0;

        image.sprite = pages[pageCount];
        FadeTool.FadeIn(0.4f);
        yield return(new WaitForSeconds(4f));

        FadeTool.FadeOut(0.4f);
        yield return(new WaitForSeconds(0.8f));

        pageCount++;
        while (pageCount < pages.Count)
        {
            image.sprite = pages[pageCount];
            FadeTool.FadeIn(0.4f);
            yield return(new WaitForSeconds(2f));

            FadeTool.FadeOut(0.4f);
            yield return(new WaitForSeconds(0.7f));

            pageCount++;
        }
        FadeTool.FadeIn(0.01f);
        anim.Play("start");
        yield return(new WaitForSeconds(2f));

        Off();
    }
Пример #3
0
    private float fadeInTime;                           // time in seconds it takes to fade in

    public TextureFrame(float timestamp, Renderer r, Texture2D tex)
    {
        this.timestamp = timestamp;
        this.r         = r;
        this.tex       = tex;
        this.origTex   = r.material.mainTexture;
        this.fadeTool  = null;
    }
Пример #4
0
 public void GameOver()
 {
     ///업적 : Gameover
     SaveManager.GetGameOver();
     FadeTool.FadeOutIn(2.5f, 1.5f, UIManager.instance.GameOverUIOn);
     SoundDelegate.instance.PlayGameOverSound(BGM.NONE, 3f);
     IsInputOk = false;
 }
Пример #5
0
 public TextureFrame(float timestamp, Renderer r, Texture2D tex, FadeTool fadeTool, float fadeInTime)
 {
     this.timestamp  = timestamp;
     this.r          = r;
     this.tex        = tex;
     this.origTex    = r.material.mainTexture;
     this.fadeTool   = fadeTool;
     this.fadeInTime = fadeInTime;
 }
Пример #6
0
 IEnumerator CreditByTimeRoutine()
 {
     bar.value = 1f;
     while (bar.value > 0f)
     {
         bar.value -= Time.deltaTime / scrollTime;
         yield return(null);
     }
     FadeTool.FadeOutIn(1.5f, 1f, ShowImage);
 }
Пример #7
0
 public static void LoadScene(string scene)
 {
     if (!IsExist())
     {
         MainMenu.isBtnEnable = true;
         SceneManager.LoadScene(scene);
     }
     FadeTool.FadeOutIn(0.5f, 0, () => { panel.LoadAsync(scene); }, null);
     //panel.LoadAsync(scene);
 }
Пример #8
0
 // Start is called before the first frame update
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Debug.LogWarning("Singleton Error! : " + this.name);
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
     fade = GameObject.Find("Canvas").transform.Find("Fade").GetComponent <Image>();
 }
Пример #9
0
    // Use this for initialization
    void Awake()
    {
        ArchLoader.instance.StartCache();
        switch (SaveManager.curEnding)
        {
        case 1: SoundDelegate.instance.PlayBGM(BGM.NORMALENDINGCUT);
            FadeTool.FadeOutIn(0.5f, 1f, ShowBadImage); break;

        case 2: SoundDelegate.instance.PlayBGM(BGM.NORMALENDINGCUT);
            FadeTool.FadeIn(1f, StartCredit); break;

        case 3: SoundDelegate.instance.PlayBGM(BGM.TRUEENDINGCUT);
            FadeTool.FadeIn(1f, StartCredit); break;

        default: break;
        }
        view = GameObject.Find("Canvas").transform.Find("Credit").GetComponent <ScrollRect>();
        bar  = view.transform.Find("Scrollbar Vertical").GetComponent <Scrollbar>();
        //content = view.transform.Find("");
        image    = GameObject.Find("Canvas").transform.Find("Image").GetComponent <Image>();
        BadImage = GameObject.Find("Canvas").transform.Find("BadImage").gameObject;
    }
Пример #10
0
    /*
     * IEnumerator CreditBySpeedRoutine()
     * {
     *  bar.value = 1f;
     *  while (bar.value > 0f)
     *  {
     *      bar.value -= Time.deltaTime * scrollSpeed;
     *      yield return null;
     *  }
     *  FadeTool.FadeOutIn(0.5f, 0.5f, ShowImage);
     * }
     */

    IEnumerator BadCreditRoutine()
    {
        pageCount = 0;

        image.sprite = badPages[pageCount];
        FadeTool.FadeIn(0.4f);
        yield return(new WaitForSeconds(4f));

        FadeTool.FadeOut(0.4f);
        yield return(new WaitForSeconds(0.8f));

        pageCount++;
        while (pageCount < badPages.Count)
        {
            image.sprite = badPages[pageCount];
            FadeTool.FadeIn(0.4f);
            yield return(new WaitForSeconds(2f));

            FadeTool.FadeOut(0.4f);
            yield return(new WaitForSeconds(0.7f));

            pageCount++;
        }
    }
Пример #11
0
 void Start()
 {
     fader = this;
 }
Пример #12
0
 void Awake()
 {
     fader = this;
 }
Пример #13
0
        public Player(GameObject playerObject, bool isOpponent)
        {
            PlayerObject  = playerObject;
            IsLocalPlayer = !isOpponent;

            _dataManager     = GameClient.Get <IDataManager>();
            _gameplayManager = GameClient.Get <IGameplayManager>();
            _soundManager    = GameClient.Get <ISoundManager>();

            _cardsController        = _gameplayManager.GetController <CardsController>();
            _battlegroundController = _gameplayManager.GetController <BattlegroundController>();
            _skillsController       = _gameplayManager.GetController <SkillsController>();
            _animationsController   = _gameplayManager.GetController <AnimationsController>();

            CardsInDeck      = new List <WorkingCard>();
            CardsInGraveyard = new List <WorkingCard>();
            CardsInHand      = new List <WorkingCard>();
            CardsOnBoard     = new List <WorkingCard>();
            BoardCards       = new List <BoardUnit>();

            CardsPreparingToHand = new List <BoardCard>();

            int heroId;

            if (!isOpponent)
            {
                if (!_gameplayManager.IsTutorial)
                {
                    heroId = _dataManager.CachedDecksData.Decks.First(d => d.Id == _gameplayManager.PlayerDeckId)
                             .HeroId;
                }
                else
                {
                    heroId = Constants.TutorialPlayerHeroId;
                }
            }
            else
            {
                heroId = _dataManager.CachedOpponentDecksData.Decks.First(d => d.Id == _gameplayManager.OpponentDeckId)
                         .HeroId;
            }

            SelfHero = _dataManager.CachedHeroesData.HeroesParsed[heroId];

            _health   = Constants.DefaultPlayerHp;
            InitialHp = _health;
            BuffedHp  = 0;
            _goo      = Constants.DefaultPlayerGoo;

            _avatarObject            = playerObject.transform.Find("Avatar/Hero_Object").gameObject;
            _overlordRegularObject   = playerObject.transform.Find("OverlordArea/RegularModel").gameObject;
            _overlordDeathObject     = playerObject.transform.Find("OverlordArea/OverlordDeath").gameObject;
            _avatarHeroHighlight     = playerObject.transform.Find("Avatar/HeroHighlight").gameObject;
            _avatarSelectedHighlight = playerObject.transform.Find("Avatar/SelectedHighlight").gameObject;

            _avatarAnimator = playerObject.transform.Find("Avatar/Hero_Object").GetComponent <Animator>();
            _deathAnimator  = _overlordDeathObject.GetComponent <Animator>();
            _gooBarFadeTool = playerObject.transform.Find("Avatar/Hero_Object").GetComponent <FadeTool>();

            _freezedHighlightObject = playerObject.transform.Find("Avatar/FreezedHighlight").gameObject;

            _avatarAnimator.enabled = false;
            _deathAnimator.enabled  = false;
            _deathAnimator.StopPlayback();

            PlayerHpChanged += PlayerHpChangedHandler;

            DamageByNoMoreCardsInDeck = 0;
        }
Пример #14
0
 public void OnSkipButtonDown()
 {
     FadeTool.Reset();
     Off();
 }