Exemplo n.º 1
0
 public void Go()
 {
     NowP        = NextP;
     Tw.from     = AllT [NowP].Obj.transform;
     Tw.to       = AllT [NextP].Obj.transform;
     Tw.duration = AllT[NowP].duration;
     Tw.ResetToBeginning();
     Tw.PlayForward();
     AllT [NowP].Eve.Invoke();
 }
Exemplo n.º 2
0
    public IEnumerator PageToLeftPageAnimation()
    {
        TweenTransform tween = Background.GetComponent <TweenTransform>();

        tween.to   = FrameWork.FindChild("Frame_Right");
        tween.from = FrameWork.FindChild("Frame_Left");
        tween.ResetToBeginning();
        tween.PlayForward();
        BackButtonTarget.SetActive(true);
        yield return(new WaitForSeconds(tween.duration));

        gameObject.SetActive(false);
    }
Exemplo n.º 3
0
    void resetTTNiao()
    {
        MDMoveTween mt = szPaths[mIndex];

        if (mt.from != null)
        {
            ttNiao.from = mt.from;
        }
        ttNiao.to             = mt.to;
        ttNiao.duration       = mt.time;
        ttNiao.animationCurve = mt.animationCurve;
        ttNiao.ResetToBeginning();
        ttNiao.PlayForward();
    }
 void ActiveChuanChangeTran()
 {
     if (IsActiveChuan)
     {
         return;
     }
     //Debug.Log("ActiveChuanChangeTran***");
     IsActiveChuan = true;
     ChuanUiGX.SetActive(true);
     ChuanTweenTranA.from = TranA;
     ChuanTweenTranA.to   = TranB;
     ChuanTweenTranA.ResetToBeginning();
     ChuanTweenTranA.enabled = true;
     ChuanTweenTranA.PlayForward();
 }
Exemplo n.º 5
0
    public void PlayAddGameTime(int timeVal)
    {
        if (timeVal <= 0)
        {
            Debug.LogError("PlayAddGameTime -> timeVal was wrong! timeVal = " + timeVal);
            return;
        }

        if (AddTimeObj.activeSelf)
        {
            return;
        }

        TweenTranScript.ResetToBeginning();
        AddTimeObj.SetActive(true);

        AddTimeVal = timeVal;
        SetTimeImg(timeVal);
        //Debug.LogWarning("*****************StartAddGameTime " + timeVal);

        TweenSclScript.ResetToBeginning();
        TweenSclScript.enabled = true;
        TweenSclScript.PlayForward();
    }
Exemplo n.º 6
0
 public void ResetAnimation()
 {
     ta.ResetToBeginning();
     tt.ResetToBeginning();
 }
    IEnumerator PlayGameTime()
    {
        if (FinishPanelCtrl.GetInstance() != null && FinishPanelCtrl.GetInstance().CheckIsActiveFinish())
        {
            StopRunGameTime();
            yield break;
        }

        if (Time.timeScale != 1f)
        {
            yield return(new WaitForSeconds(1.0f));

            yield return(StartCoroutine(PlayGameTime()));
        }

        SetTimeValToImg();

        if (GameTimeValCur <= 0 && !AddGameTimeCtrl.GetInstance().GetIsActiveAddTime())
        {
            InsertCoinCtrl.GetInstanceP2().HiddenInsertCoin();
            StartBtCtrl.GetInstanceP2().CloseStartBtCartoon();
            HeadCtrlPlayer.GetInstanceP1().SetHeadColor();
            HeadCtrlPlayer.GetInstanceP2().SetHeadColor();

            ResetTimeHMvalToImg();
            StopCoroutine(SetTimeHMvalToImg());
            StopCoroutine(PlayGameTime());
            IsInitPlayTime = false;
            StartBtCtrl.GetInstanceP1().ResetIsActivePlayer();
            StartBtCtrl.GetInstanceP2().ResetIsActivePlayer();

            if (GlobalData.GetInstance().gameMode == GameMode.OnlineMode)
            {
                gameObject.SetActive(false);
                RankingCtrl.GetInstance().StopCheckPlayerRank();

                //FinishPanelCtrl.GetInstancePlayer().ShowFinishPanel();

                if (WaterwheelPlayerNetCtrl.GetInstance().GetPlayerRankNo() == 1)
                {
                    FinishPanelCtrl.GetInstance().ShowFinishPanel();
                }
                else
                {
                    FinishPanelCtrl.GetInstancePlayer().ShowFinishPanel();
                }
            }
            else
            {
                GameOverCtrl.GetInstance().ShowContinueGame();
                DaoJiShiCtrl.GetInstance().InitPlayDaoJiShi();
            }
            yield break;
        }
        yield return(new WaitForSeconds(1.0f));

        if (GameTimeValCur <= 10 && GameTimeValCur >= 1 && !TimeTTran.enabled)
        {
            TimeTTran.ResetToBeginning();
            TimeTTran.enabled = true;
            TimeTTran.PlayForward();
            if (GameTimeValCur == 10)
            {
                GameDaoJiShiCtrl.GetInstance().StartPlayDaoJiShi();
                CreateAudioSourceTime();
                AudioSourceTime.Play();
            }
        }

        if (!AddGameTimeCtrl.GetInstance().GetIsActiveAddTime())
        {
            GameTimeValCur--;
        }

        if (GameTimeValCur <= 0 && TimeTTran.enabled)
        {
            TimeTTran.enabled = false;
            if (AudioSourceTime != null && AudioSourceTime.isPlaying)
            {
                AudioSourceTime.Stop();
            }
        }
        yield return(StartCoroutine(PlayGameTime()));
    }
    void MoveCamera(CameraPathCtrl path)
    {
        if (path == null)
        {
            Debug.LogError("MoveCamera -> path is null!");
            return;
        }
        NoiseScript.enabled = false;

        if (path.IsOnlyChangeRot)
        {
            TweenTransform TweenTranscript = GmObj.GetComponent <TweenTransform>();
            if (TweenTranscript == null)
            {
                TweenTranscript = gameObject.AddComponent <TweenTransform>();
            }
            TweenTranscript.enabled = false;

            GmTran.position = path.CamRotation_1.position;
            GmTran.rotation = path.CamRotation_1.rotation;

            TweenTranscript.from     = path.CamRotation_1;
            TweenTranscript.to       = path.CamRotation_2;
            TweenTranscript.duration = path.TimeVal;
            TweenTranscript.style    = UITweener.Style.Once;
            TweenTranscript.ResetToBeginning();

            EventDelegate.Add(TweenTranscript.onFinished, delegate {
                OnFinishMoveCamera();
            });

            TweenTranscript.enabled = true;
            TweenTranscript.PlayForward();
        }
        else if (path.IsMvPosByCamPath)
        {
            GmTran.position = path.GetCamPathTranFirst().position;
            GmTran.rotation = path.GetCamPathTranFirst().rotation;

            iTween.MoveTo(GmObj, iTween.Hash("path", path.GetCamPathTranArray(),
                                             "time", path.TimeVal,
                                             "easeType", iTween.EaseType.linear,
                                             "oncomplete", "OnFinishMoveCamera"));
        }
        else if (path.IsMvRotByCamPath)
        {
            GmTran.position = path.GetCamPathTranFirst().position;
            GmTran.rotation = path.GetCamPathTranFirst().rotation;

            iTween.MoveTo(GmObj, iTween.Hash("path", path.GetCamPathTranArray(),
                                             "time", path.TimeVal,
                                             "orienttopath", true,
                                             "easeType", iTween.EaseType.linear,
                                             "oncomplete", "OnFinishMoveCamera"));
        }
        else if (path.IsMvAimByCamPath)
        {
            GmTran.position = path.GetCamPathTranFirst().position;
            GmTran.rotation = path.GetCamPathTranFirst().rotation;

            iTween.MoveTo(GmObj, iTween.Hash("path", path.GetCamPathTranArray(),
                                             "time", path.TimeVal,
                                             "looktarget", path.CamAimPoint,
                                             "easeType", iTween.EaseType.linear,
                                             "oncomplete", "OnFinishMoveCamera"));
        }
    }