Exemple #1
0
    public override void OnPush()
    {
        this.label_exp.text  = expParam.ToString();
        this.label_gold.text = goldParam.ToString();

        goldGroup.gameObject.SetActive(true);
        expGroup.gameObject.SetActive(true);

        {
            var light = this.transform.Find("light");
            iTween.Stop(light.gameObject);
            iTween.RotateBy(light.gameObject, iTween.Hash("amount", new Vector3(0, 0, 1), "time", 200, "looptype", iTween.LoopType.loop, "easetype", iTween.EaseType.linear));
        }

        {
            var right = this.transform.Find("ring_right");
            var light = right.Find("light");
            iTween.Stop(light.gameObject);
            iTween.RotateBy(light.gameObject, iTween.Hash("amount", new Vector3(0, 0, 1), "time", 10, "looptype", iTween.LoopType.loop, "easetype", iTween.EaseType.linear));
        }

        {
            var left  = this.transform.Find("ring_left");
            var light = left.Find("light");
            iTween.Stop(light.gameObject);
            iTween.RotateBy(light.gameObject, iTween.Hash("amount", new Vector3(0, 0, 1), "time", 10, "looptype", iTween.LoopType.loop, "easetype", iTween.EaseType.linear));
        }
        CoroutineManager.Create(Popup());
    }
Exemple #2
0
 static AudioManager()
 {
     root = new GameObject("AudioServiceRoot");
     root.AddComponent <AudioListener>();
     CoroutineManager.Create(UpdateAsyn());
     GameObject.DontDestroyOnLoad(root);
 }
Exemple #3
0
    public void OnGotButton()
    {
        if (PlayerStatus.IsTodaySigned())
        {
            return;
        }
        var day  = PlayerStatus.sign + 1;
        var gold = GetGoldOfDay(day);

        PlayerStatus.gold += gold;
        PlayerStatus.sign += 1;
        SetLastSignDayAsToday();
        PlayerStatus.Save();

        if (selectItem1 != null)
        {
            selectItem1.Flash();
            selectItem1.IsGot = true;
        }
        if (selectItem2 != null)
        {
            selectItem2.Flash();
            selectItem2.IsGot = true;
        }

        button_got.interactable = false;
        var text = button_got.GetComponentInChildren <Text>();

        text.text  = "已领取";
        text.color = new Color(1f, 1f, 1f, 0.7f);
        AudioManager.PlaySe("gain-gold");
        CoroutineManager.Create(WaitAndBack());
        RadioStation.Brodcast("SIGN");
    }
Exemple #4
0
    public override void OnPush()
    {
        //button_gift.gameObject.SetActive(SDKManager.IsAdLoaded);
        image_pic.gameObject.SetActive(false);
        button_layout.gameObject.SetActive(false);
        var sprite = PicLibrary.LoadContentSpriteById(PicId);

        image_pic.sprite = sprite;
        CoroutineManager.Create(TimeTaks());
    }
Exemple #5
0
    public override void OnPush()
    {
        var floating = UIEngine.ShowFloating <BackgroundFloating>(null, UIDepth.Low);

        floating.transform.SetAsFirstSibling();
        UIEngine.ShowFloating <HeadBarFloating>();

        if (!PlayerStatus.IsTodaySigned())
        {
            CoroutineManager.Create(WaitAndShowSign());
        }

        Refrehs();

        TryGuid();
    }
Exemple #6
0
    public void OnRootPiceDragEnd(Pice pice)
    {
        lastDragPice = pice;
        UpdatePiceOwner(pice);
        // 没有连结的 pice, 当拖放释放点不在 board 上时,自动回到 side 上
        if (pice.linkingList.Count == 0)
        {
            var inboard = board.Rect.Contains(pice.transform.position);
            if (!inboard)
            {
                var insertIndex = side.GetNearestCellIndex(pice);
                PiceMover.SetToSide(pice, insertIndex);
                side.RepositionPiceList();
                side.scrollView.AnimateFixContentPosition();
                return;
            }
        }

        // 应该放置到 board 上时
        //board.PlacePice(pice);
        var index = board.GetNearestCellIndex(pice);

        PiceMover.SetBlockToBoard(pice, index.x, index.y);
        var x = board.GetCenterX(index.x);
        var y = board.GetCenterY(index.y);

        pice.TweenBlockToPosition(x, y);
        //board.RepositionAllPice();

        CheckNewLink();
        CheckNewFix();
        var complete = IsAllPiceFixed();

        if (complete)
        {
            Debug.Log("[Core] Complete");
            CoroutineManager.Create(PlayCompleteTask());
        }
    }
Exemple #7
0
 public void OnFullButton()
 {
     CoroutineManager.Create(Task());
 }
Exemple #8
0
 private void Update()
 {
     m_coroutineManager.Create()
     .Enqueue(OnCoroutineFinish)
     .StartCoroutine();
 }
Exemple #9
0
 public override void OnPush()
 {
     CoroutineManager.Create(PreloadingTask());
 }
 public override void Play(Page oldPage, Page newPage)
 {
     CoroutineManager.Create(PlayCR(oldPage, newPage));
 }
 public void OnBackButton()
 {
     if (UIEngine.PagesCount > 1)
     {
         var top = UIEngine.Top;
         if (top is LevelCompletePage)
         {
             // do nothing
         }
         else if (top is DisplayPage)
         {
             // do nothing
         }
         else if (top is DialogPage)
         {
             // do nothing
             var dialog = top as DialogPage;
             dialog.OnCloseButton();
         }
         else if (top is AdPage)
         {
             // do nothing
             var adPage = top as AdPage;
             adPage.OnCloseButton();
         }
         if (top is LevelSettingsPage)
         {
             var admin = new Admission_PopdownOldPage();
             UIEngine.Back(null, admin);
         }
         else if (top is ShopPage)
         {
             var admin = new Admission_OldDownNewUp();
             UIEngine.Back(null, admin);
         }
         else if (top is CorePage)
         {
             var param = new DialogParam();
             param.des    = "退出会存储已进行的拼图,确定要退出吗?";
             param.button = "确定";
             var popup  = new Admission_PopupNewPage();
             var dialog = UIEngine.Forward <DialogPage>(param, popup);
             dialog.Complete = DialogResult =>
             {
                 if (DialogResult == DialogResult.Conform)
                 {
                     GameController.SaveUncompletePuzzle();
                     //UIEngine.BackTo<PicturePage>();
                     CoroutineManager.Create(WaitAndReturn());
                 }
             };
         }
         else
         {
             UIEngine.Back(null, admission);
         }
         AudioManager.PlaySe("button");
         SDKManager.OnHeadBarBackbutton();
     }
     else
     {
         Debug.Log("this is the only one page, can't call UIEngine.Back()");
     }
 }
 public void ScaleExp()
 {
     CoroutineManager.Create(_ScaleExpTask());
 }
 public void ScaleGold()
 {
     CoroutineManager.Create(_ScaleGoldTask());
 }
Exemple #14
0
 public static void WateAdmissionComplete(Action callback)
 {
     CoroutineManager.Create(_WateAdmissionCompleteTask(callback));
 }