コード例 #1
0
 void Update()
 {
     timer += Time.deltaTime;
     if (fishingToLeCanvas.enabled == false)
     {
         start = false;
     }
     if (start)
     {
         SpawnBubbles();
         FisherRotate();
         EmitterBullet();
     }
     if (fishingToLeCanvas.enabled == false && bubbleQueue.childCount > 0)
     {
         Clear();
     }
     if (randomSprite)
     {
         InitShowPic();
         randomSprite = false;
     }
     if (faillCanvas == null && showedNum < pic.transform.childCount && countDownBar.value <= countDownBar.minValue)
     {
         //faillCanvas = Instantiate(Resources.Load<Canvas>(ConstLib.PREFAB_FAILLCANVAS), fishingToLeCanvas.transform);
         faillCanvas = ToolLib.EndTig(false, fishingToLeCanvas.transform);
     }
 }
コード例 #2
0
ファイル: CScriptLuaMgr.cs プロジェクト: liuxx220/GameApp
    public void InitLuaMgr( )
    {
        m_luaState = LuaAPI.NewState();
        m_luaState.L_OpenLibs();

        ToolLib.LuaOpenCommonLib(m_luaState);
    }
コード例 #3
0
        /// <summary>
        ///  登入
        /// </summary>
        /// <param name="account">帳號</param>
        /// <param name="password">密碼</param>
        /// <param name="stationID">服務台ID</param>
        /// <param name="counterID">櫃台ID</param>
        /// <param name="result"></param>
        /// <returns></returns>
        public bool Login(string account, string password, string stationID, SystemModeType type, string id, out LoginJsonResult result)
        {
            try
            {
                NameValueCollection nc = new NameValueCollection();

                string rumUrl = $"{this.Url}/Caller_Login";

                nc["account"]   = account;
                nc["password"]  = password;
                nc["stationID"] = stationID;
                string mode = ToolLib.GetEnumDescription(type);
                nc["type"] = mode;
                nc["id"]   = id;

                var resultJsonString = GetData(rumUrl, nc);

                //log.Info($"登入:{rumUrl},參數:", nc);

                result = JsonConvert.DeserializeObject <LoginJsonResult>(resultJsonString);
            }
            catch (Exception ex)
            {
                result = new LoginJsonResult
                {
                    Result  = ((int)MessageCodeType.例外訊息).ToString(),
                    Message = $"連線失敗:{ex.Message},請確認網路連線是否正常。"
                };

                log.Error("登入:" + result.Message);
            }

            return(result.IsEffective);
        }
コード例 #4
0
ファイル: BuyProps.cs プロジェクト: Goulandis/NewYearPictures
    public void Click()
    {
        if (gameObject.name == ConstLib.BTNSHOP)
        {
            manager.Push(shopCanvas);
        }
        else if (gameObject.name == ConstLib.BTNBUYBOOM)
        {
            if (ConstLib.Integral >= buyBoomIntegral)
            {
                ConstLib.Integral -= buyBoomIntegral;
                ConstLib.WriteIntegral();
                PlayerState.prop.BoomNum++;
                PlayerState.SetBoomNum();
                //Text txt = Instantiate(Resources.Load<Text>(ConstLib.PREFAB_TIG), shopCanvas.transform);
                //txt.text = Convert.ToString("购买成功");
                ToolLib.Tig(shopCanvas.transform, "购买成功");
            }
        }
        else if (gameObject.name == ConstLib.BTNBUYTIMEADD)
        {
            if (ConstLib.Integral >= buyTimeAddIntegral)
            {
                ConstLib.Integral -= buyTimeAddIntegral;
                ConstLib.WriteIntegral();
                PlayerState.prop.TimeAddNum++;
                PlayerState.SetTimeAddNum();
                //Text txt = Instantiate(Resources.Load<Text>(ConstLib.PREFAB_TIG), shopCanvas.transform);
                //txt.text = Convert.ToString("购买成功");

                ToolLib.Tig(shopCanvas.transform, "购买成功");
            }
        }
    }
コード例 #5
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         Pop();
     }
     if (Input.GetKeyDown(KeyCode.Q))
     {
         if (stateCanvasClone == null)
         {
             stateCanvasClone = Instantiate(stateCanvas);
             stateCanvasClone.GetComponent <StateCanvasScript>().InitState();
         }
     }
     if (Input.GetKeyUp(KeyCode.Q))
     {
         if (stateCanvasClone != null)
         {
             Destroy(stateCanvasClone.gameObject);
         }
     }
     if (Input.GetKeyDown(KeyCode.W))
     {
         if (PlayerState.prop.BoomNum > 0)
         {
             if (PlayerState.usingBoom == false)
             {
                 PlayerState.usingBoom = true;
                 ToolLib.Tig(UIStack.Peek().transform, "炸弹已激活");
             }
         }
         else
         {
             ToolLib.Tig(UIStack.Peek().transform, "炸弹已用完");
         }
     }
     if (Input.GetKeyDown(KeyCode.E))
     {
         Canvas canvas = UIStack.Peek();
         if (ConstLib.GAMECANVAS.Contains(canvas.name))
         {
             PlayerState.usingTimeAdd = true;
         }
         if (PlayerState.usingTimeAdd == true)
         {
             if (canvas.transform.Find(ConstLib.COUNDOWNBAR) != null)
             {
                 canvas.transform.Find(ConstLib.COUNDOWNBAR).GetComponent <Timer>().TimerAdd();
             }
             else if (canvas.name == ConstLib.ANSWERCANVAS)
             {
                 canvas.transform.parent.transform.Find(ConstLib.COUNDOWNBAR).GetComponent <Timer>().TimerAdd();
             }
         }
     }
 }
コード例 #6
0
 public void TimerAdd()
 {
     if (PlayerState.prop.TimeAddNum > 0)
     {
         PlayerState.prop.TimeAddNum--;
         PlayerState.usingTimeAdd = false;
         PlayerState.SetTimeAddNum();
         countDownBar.value += ConstLib.TimeAddInterval;
         ToolLib.Tig(gameObject.transform, "时间已增加10秒");
     }
 }
コード例 #7
0
    void NextLevel()
    {
        Clear();
        InitCanvas();
        InitNewYearPic();

        ToolLib.Tig(eliminateToLeCanvas.transform, ConstLib.EliminateToLeIntegral.ToString());

        ConstLib.Integral += ConstLib.EliminateToLeIntegral;
        ConstLib.WriteIntegral();
    }
コード例 #8
0
 void Update()
 {
     if (eliminateToLeCanvas.enabled == false && eliminateToLeCanvas.transform.childCount > 0)
     {
         Clear();
     }
     if (faillCanvas == null && hasClearArea == false && countDownBar.value <= countDownBar.minValue)
     {
         //faillCanvas = Instantiate(Resources.Load<Canvas>(ConstLib.PREFAB_FAILLCANVAS), eliminateToLeCanvas.transform);
         faillCanvas = ToolLib.EndTig(false, eliminateToLeCanvas.transform);
     }
 }
コード例 #9
0
ファイル: TopicLib.cs プロジェクト: Goulandis/NewYearPictures
    void NextLevel()
    {
        currentQuestions   = 0;
        countDownBar.value = countDownBar.maxValue;
        topicIndex         = 0;
        requstProportion  += 0.05f;
        GetTopics();
        SetTopics(topicNO[0]);

        ToolLib.Tig(kownHowMuchCanvas.transform, ConstLib.KownHowMuchIntegral.ToString());

        ConstLib.Integral += ConstLib.KownHowMuchIntegral;
        ConstLib.WriteIntegral();
    }
コード例 #10
0
ファイル: TopicLib.cs プロジェクト: Goulandis/NewYearPictures
 void Update()
 {
     if (answerCanvas.enabled == false)
     {
         topicIndex       = 0;
         currentQuestions = 0;
     }
     if (faillCanvas == null && vectoryCanvas == null && countDownBar.value <= countDownBar.minValue && currentQuestions < requstQuestions)
     {
         //弹出失败界面
         //faillCanvas = Instantiate(Resources.Load<Canvas>(ConstLib.PREFAB_FAILLCANVAS), kownHowMuchCanvas.transform);
         faillCanvas = ToolLib.EndTig(false, kownHowMuchCanvas.transform);
     }
 }
コード例 #11
0
    public static int CL_SetNPCTalkOption(ILuaState lua)
    {
        uint   questid    = lua.L_CheckUnsigned(1);
        int    step       = lua.L_CheckInteger(2);
        bool   bNpcSay    = lua.L_CheckInteger(3) == 1 ? true : false;
        string strCaption = ToolLib.EncUTF8(lua.ToString(4));


        CNPCTalkFrame pFrame = (CNPCTalkFrame)GameUIManager.Instance().GetFrame(GUIDefine.UIF_NPCTALKFRAME);

        if (pFrame != null)
        {
            pFrame.SetQuestTalkOption(questid, step, bNpcSay, strCaption);
        }
        return(0);
    }
コード例 #12
0
ファイル: TopicLib.cs プロジェクト: Goulandis/NewYearPictures
    public void Click()
    {
        //遍历所有答案,判断当前勾选答案是否为正确答案
        if (topicIndex < topicNO.Count)
        {
            foreach (Toggle toggle in toggles)
            {
                if (toggle.isOn == true)
                {
                    if (toggle.tag == Convert.ToString(topicArr[topicNO[topicIndex]][RIGHTANSWER]) &&
                        countDownBar.value > countDownBar.minValue)
                    {
                        //计分
                        currentQuestions++;
                    }
                }
            }

            //如果时间未结束,平且分数达到要求值,就弹出胜利框
            if (countDownBar.value > countDownBar.minValue && currentQuestions >= requstQuestions)
            {
                if (requstProportion >= 1f)
                {
                    //vectoryCanvas = Instantiate(Resources.Load<Canvas>(ConstLib.PREFAB_VECTORYCANVASP), kownHowMuchCanvas.transform);
                    vectoryCanvas = ToolLib.EndTig(true, kownHowMuchCanvas.transform);
                }

                NextLevel();
                return;
            }

            topicIndex++;
        }

        //在题库中至少有两个题时才激活下一题切换
        if (topicIndex < topicNO.Count)
        {
            SetTopics(topicNO[topicIndex]);
        }
    }