コード例 #1
0
    // Use this for initialization
    IEnumerator DoPlay()
    {
        if (animator && !string.IsNullOrEmpty(takeStart))
        {
            animator.Play(takeStart);
            while (animator.isPlaying)
            {
                yield return(null);
            }
        }

        //music
        if (!string.IsNullOrEmpty(playMusicPath))
        {
            LoLMusicPlaylist.instance.Stop(); //ensure playlist is stopped

            LoLManager.instance.PlaySound(playMusicPath, true, true);
        }
        else if (startMusicPlaylist)
        {
            LoLMusicPlaylist.instance.Play();
        }

        //start up the first page
        mCurPageInd = 0;
        ShowCurrentPage();
    }
コード例 #2
0
    IEnumerator DoReceive()
    {
        if (body)
        {
            body.simulated = false;
        }

        if (animator && !string.IsNullOrEmpty(takeReceive))
        {
            animator.Play(takeReceive);
            while (animator.isPlaying)
            {
                yield return(null);
            }
        }

        if (signalNext != null)
        {
            signalNext.Invoke();
        }

        if (animator && !string.IsNullOrEmpty(takeNext))
        {
            animator.Play(takeNext);
        }
    }
コード例 #3
0
 public void PlayEnter()
 {
     if (animator && !string.IsNullOrEmpty(takeEnter))
     {
         animator.Play(takeEnter);
     }
 }
コード例 #4
0
 void OnSignalPlayReady()
 {
     if (animator && !string.IsNullOrEmpty(takeEnter))
     {
         animator.Play(takeEnter);
     }
 }
コード例 #5
0
    public void Error()
    {
        M8.SoundPlaylist.instance.Play(sfxError, false);

        if (animator && !string.IsNullOrEmpty(takeError))
        {
            animator.Play(takeError);
        }
    }
コード例 #6
0
    IEnumerator M8.SceneManager.ITransition.Out()
    {
        activeGO.SetActive(true);

        animator.Play(mTakeOutInd);
        while (animator.isPlaying)
        {
            yield return(null);
        }
    }
コード例 #7
0
 IEnumerator IModalOpening.Opening()
 {
     if (animator && !string.IsNullOrEmpty(takeOpen))
     {
         animator.Play(takeOpen);
         while (animator.isPlaying)
         {
             yield return(null);
         }
     }
 }
コード例 #8
0
    IEnumerator DoPrincessDistress()
    {
        princessGO.SetActive(true);

        princessAnim.Play(princessTakeEnter);

        while (princessAnim.isPlaying)
        {
            yield return(null);
        }

        princessAnim.Play(princessTakeHelp);
    }
コード例 #9
0
    void OnRoundEnd()
    {
        var playerCtrl = PlayController.instance;

        //update score
        if (scoreCounter)
        {
            if (scoreCounter.count != playerCtrl.curScore)
            {
                scoreCounter.count = playerCtrl.curScore;

                if (scoreAnimator && !string.IsNullOrEmpty(scoreTakeUpdate))
                {
                    scoreAnimator.Play(scoreTakeUpdate);
                }
            }
        }

        //do combo display if available
        if (playerCtrl.comboIsActive)
        {
            if (mComboDisplayRout == null)
            {
                mComboDisplayRout = StartCoroutine(DoComboDisplay());
            }
        }
    }
コード例 #10
0
    IEnumerator DoProcess()
    {
        highlight.enabled = false;

        if (animator && !string.IsNullOrEmpty(takeProcess))
        {
            yield return(animator.PlayWait(takeProcess));
        }

        //apply
        switch (mode)
        {
        case Mode.FractionToWhole:
            target.number.FractionToWholeSingle();
            break;

        case Mode.WholeToFraction:
            target.number.WholeToFractionSingle();
            break;
        }

        target.RefreshDisplay();

        if (!string.IsNullOrEmpty(takeFinish))
        {
            animator.Play(takeFinish);
        }

        mProcessRout = null;

        highlight.enabled = IsValid();
    }
コード例 #11
0
    protected override void OnLaunched()
    {
        base.OnLaunched();

        if (!mIsAngleChanged)
        {
            cannonAngleDragHelpGO.SetActive(false);
            mIsAngleChanged = true;
        }

        graphReminderGO.SetActive(false);

        launchReadyGO.SetActive(false);
        cannonLaunch.interactable = false;

        cannonAnimator.Play(cannonTakeLaunch);

        if (!string.IsNullOrEmpty(cannonLaunchSfxPath))
        {
            LoLManager.instance.PlaySound(cannonLaunchSfxPath, false, false);
        }

        var ent = cannonballSpawner.Spawn();

        StartCoroutine(DoLaunch(ent));
    }
コード例 #12
0
 public void UpdatePlay()
 {
     if (animator && !string.IsNullOrEmpty(takeUpdate))
     {
         animator.Play(takeUpdate);
     }
 }
コード例 #13
0
 void IModalActive.SetActive(bool aActive)
 {
     if (aActive)
     {
         if (animator && !string.IsNullOrEmpty(takeActive))
         {
             animator.Play(takeActive);
         }
     }
     else
     {
         if (animator && !string.IsNullOrEmpty(takeInactive))
         {
             animator.Play(takeInactive);
         }
     }
 }
コード例 #14
0
    IEnumerator DoSpawn()
    {
        if (animator && !string.IsNullOrEmpty(takeSpawn))
        {
            animator.Play(takeSpawn);
            while (animator.isPlaying)
            {
                yield return(null);
            }
        }
        else
        {
            yield return(null);
        }

        mRout = null;

        unit.state = spawnAfterState;
    }
コード例 #15
0
    IEnumerator DoEnter()
    {
        displayGO.SetActive(true);

        if (animator)
        {
            if (!string.IsNullOrEmpty(takeEnter))
            {
                yield return(animator.PlayWait(takeEnter));
            }

            if (!string.IsNullOrEmpty(takeIdle))
            {
                animator.Play(takeIdle);
            }
        }

        mRout = null;
    }
コード例 #16
0
    IEnumerator DoAttack()
    {
        if (animator && !string.IsNullOrEmpty(takeAttack))
        {
            animator.Play(takeAttack);
        }

        if (attackActiveGO)
        {
            attackActiveGO.SetActive(true);
        }

        yield return(new WaitForSeconds(attackDelay));

        if (attackActiveGO)
        {
            attackActiveGO.SetActive(false);
        }

        mCurRout = null;
    }
コード例 #17
0
    IEnumerator DoComboDisplay()
    {
        ApplyCurrentComboCountDisplay();

        if (comboGO)
        {
            comboGO.SetActive(true);
        }

        if (comboAnimator && !string.IsNullOrEmpty(comboTakeEnter))
        {
            yield return(comboAnimator.PlayWait(comboTakeEnter));
        }

        var comboDuration = GameData.instance.comboDuration;

        var playCtrl = PlayController.instance;

        while (playCtrl.comboIsActive)
        {
            if (mCurComboCountDisplay != playCtrl.comboCount)
            {
                ApplyCurrentComboCountDisplay();

                if (comboAnimator && !string.IsNullOrEmpty(comboTakeUpdate))
                {
                    comboAnimator.Play(comboTakeUpdate);
                }
            }

            if (comboTimeFill)
            {
                comboTimeFill.fillAmount = 1.0f - Mathf.Clamp01(playCtrl.comboCurTime / comboDuration);
            }

            yield return(null);
        }

        if (comboAnimator && !string.IsNullOrEmpty(comboTakeExit))
        {
            yield return(comboAnimator.PlayWait(comboTakeExit));
        }

        //clear combo display
        if (comboGO)
        {
            comboGO.SetActive(false);
        }

        mCurComboCountDisplay = 0;

        mComboDisplayRout = null;
    }
コード例 #18
0
    IEnumerator DoAcquire(DeviceItem item)
    {
        HUD.instance.Hide();

        if (rootGO)
        {
            rootGO.SetActive(true);
        }

        if (item.displayGO)
        {
            item.displayGO.SetActive(true);
        }

        if (animator && !string.IsNullOrEmpty(takeEnter))
        {
            animator.Play(takeEnter);
        }

        //show modal
        mModalParms[AcquisitionModal.parmItems] = item.acquisitionItems;

        M8.ModalManager.main.Open(modalAcquire, mModalParms);

        //wait for modal to close
        while (M8.ModalManager.main.isBusy || M8.ModalManager.main.IsInStack(modalAcquire))
        {
            yield return(null);
        }

        if (animator && !string.IsNullOrEmpty(takeExit))
        {
            yield return(animator.PlayWait(takeExit));
        }

        if (item.displayGO)
        {
            item.displayGO.SetActive(false);
        }

        if (rootGO)
        {
            rootGO.SetActive(false);
        }

        HUD.instance.Show();

        mRout = null;
    }
コード例 #19
0
    public void MineralProcess()
    {
        int mineralsCount = inventory.mineralsCount;

        inventory.ClearMineralsCount();

        PlayFurnaceSound();

        //machine animation
        if (furnaceAnimator && !string.IsNullOrEmpty(furnaceTakeAction))
        {
            furnaceAnimator.Play(furnaceTakeAction);
        }

        mFurnaceActionLastTime = Time.time;
        if (mFurnaceActionRout == null)
        {
            mFurnaceActionRout = StartCoroutine(DoFurnaceAction());
        }

        if (mineralsCount < inventory.magma.capacity)
        {
            inventory.magma.count += inventory.magma.capacity;
        }
        else
        {
            inventory.magma.count += mineralsCount;
        }

        RefreshFireDisplay();

        StartCoroutine(DoChangeInterface());

        //show exit
        exitInstructGO.SetActive(true);
    }
コード例 #20
0
    IEnumerator DoSpawn()
    {
        if (animator && !string.IsNullOrEmpty(takeSpawn))
        {
            animator.Play(takeSpawn);
            while (animator.isPlaying)
            {
                yield return(null);
            }
        }
        else
        {
            yield return(null);
        }

        if (spawnDelay > 0f)
        {
            yield return(new WaitForSeconds(spawnDelay));
        }

        mRout = null;

        stateControl.state = spawnAfterState;
    }
コード例 #21
0
    public void Close()
    {
        if (mRout != null)
        {
            StopCoroutine(mRout);
            mRout = null;
        }

        mLogQueue.Clear();

        if (animator && !string.IsNullOrEmpty(takeExit))
        {
            animator.Play(takeExit);
        }
    }
コード例 #22
0
    IEnumerator DoPlay()
    {
        while (true)
        {
            var delay = Random.Range(delayMin, delayMax);
            yield return(new WaitForSeconds(delay));

            animator.animScale = Random.Range(animScaleMin, animScaleMax);

            animator.Play(take);
            while (animator.isPlaying)
            {
                yield return(null);
            }
        }
    }
コード例 #23
0
    public void UpdateValue(float curHP)
    {
        mCurHP = curHP;

        if (aliveGO)
        {
            aliveGO.SetActive(mCurHP > 0f);
        }
        if (deadGO)
        {
            deadGO.SetActive(mCurHP <= 0f);
        }

        fillImage.fillAmount = Mathf.Clamp01(mCurHP / mHPMax);

        if (animator && !string.IsNullOrEmpty(takeUpdate))
        {
            animator.Play(takeUpdate);
        }
    }
コード例 #24
0
    IEnumerator DoPlay(Vector2 toPos)
    {
        if (body)
        {
            body.simulated = false;
        }
        if (coll)
        {
            coll.enabled = false;
        }

        var     trans   = transform;
        Vector2 fromPos = trans.position;
        Vector2 fromUp  = trans.up;

        //move to destination
        var   easeFunc = DG.Tweening.Core.Easing.EaseManager.ToEaseFunction(moveEase);
        float curTime  = 0f;

        while (curTime < moveDelay)
        {
            yield return(null);

            curTime += Time.deltaTime;

            float t = easeFunc(curTime, moveDelay, 0f, 0f);

            trans.position = Vector2.Lerp(fromPos, toPos, t);
            trans.up       = Vector2.Lerp(fromUp, Vector2.up, t);
        }

        //play animation
        if (animator && !string.IsNullOrEmpty(takePlay))
        {
            animator.Play(takePlay);
            while (animator.isPlaying)
            {
                yield return(null);
            }
        }
    }
コード例 #25
0
    protected override IEnumerator Start()
    {
        if (!string.IsNullOrEmpty(musicPath))
        {
            LoLManager.instance.PlaySound(musicPath, true, true);
        }

        yield return(base.Start());

        yield return(new WaitForSeconds(startDelay));

        animator.Play(takePlay);
        while (animator.isPlaying)
        {
            yield return(null);
        }

        yield return(new WaitForSeconds(endDelay));

        GameData.instance.Progress();
    }
コード例 #26
0
    IEnumerator DoStateChange()
    {
        if (animator && !string.IsNullOrEmpty(take))
        {
            animator.Play(take);
            if (waitForAnimationEnd)
            {
                while (animator.isPlaying)
                {
                    yield return(null);
                }
            }
        }

        if (waitDelay > 0f)
        {
            yield return(new WaitForSeconds(waitDelay));
        }

        entity.state = stateTo;
    }
コード例 #27
0
    void OnInputSubmit()
    {
        //fail-safe, shouldn't be able to submit
        if (mOperation == null || mOperation.isAnyOperandEmpty || isBusy)
        {
            return;
        }

        var opAnswer = mOperation.Evaluate();

        //NOTE: assume we can only input positives
        opAnswer.isNegative = false;

        bool isCorrect = answerInput.number.isValid && answerInput.number == opAnswer;

        if (isCorrect)
        {
            answerInput.CloseNumpad();

            M8.SoundPlaylist.instance.Play(audioCorrect, false);
        }
        else
        {
            M8.SoundPlaylist.instance.Play(audioWrong, false);

            if (animator && !string.IsNullOrEmpty(takeWrong))
            {
                animator.Play(takeWrong);
            }
        }

        //end drag instruction
        if (isCorrect)
        {
            DragInstructEnd();
        }

        signalAnswer.Invoke(isCorrect);
    }
コード例 #28
0
    void ApplyDisplay(bool isUpdate)
    {
        float percent = (float)magma.count / magma.capacity;

        if (isUpdate && percentUpdateDelay > 0f)  //animate
        {
            mPrevPercent    = mCurPercent;
            mToPercent      = percent;
            mLastChangeTime = Time.time;

            if (animator && !string.IsNullOrEmpty(takeUpdate))
            {
                animator.Play(takeUpdate);
            }
        }
        else   //apply directly
        {
            mCurPercent = mPrevPercent = mToPercent = percent;

            ApplyText();
            ApplySlider();
        }
    }
コード例 #29
0
    void IBeginDragHandler.OnBeginDrag(PointerEventData eventData)
    {
        if (inputLocked)
        {
            return;
        }

        if (animator && !string.IsNullOrEmpty(takeDragBegin))
        {
            animator.Play(takeDragBegin);
        }

        if (highlightGO)
        {
            highlightGO.SetActive(false);
        }

        transform.SetParent(mDragAreaRoot);

        isDragging = true;

        DragUpdate(eventData);
    }
コード例 #30
0
    protected override IEnumerator Start()
    {
        yield return(base.Start());

        //show targets
        ShowTargets();
        yield return(new WaitForSeconds(1.5f));

        //intro part
        seqDlgIntro.Play();
        while (seqDlgIntro.isPlaying)
        {
            yield return(null);
        }

        cannonEnterAnimator.Play(cannonEnterTake);
        while (cannonEnterAnimator.isPlaying)
        {
            yield return(null);
        }
        cannonEnterAnimator.gameObject.SetActive(false);

        yield return(new WaitForSeconds(1.0f));

        seqDlgPlay.Play();
        while (seqDlgPlay.isPlaying)
        {
            yield return(null);
        }

        yield return(new WaitForSeconds(1.0f));

        //everything ready
        cannonInterfaceGO.SetActive(true);

        //enable force/angle input
        angleSlider.interactable = true;
        forceSlider.interactable = true;

        //enable cannon launch
        launchReadyGO.SetActive(true);
        cannonLaunch.interactable = true;

        if (trajectoryDisplayControl)
        {
            trajectoryDisplayControl.show = true;
        }
        //

        //first time shows
        mIsAngleChanged = false;
        cannonAngleDragHelpGO.SetActive(true);

        mIsShowGraphReminder = true;
        //

        //wait for launch
        mIsLaunchWait = true;
        while (mIsLaunchWait)
        {
            yield return(null);
        }

        //wait for cannon launch ready
        while (!cannonLaunch.interactable)
        {
            yield return(null);
        }

        //remind about the graph
    }