Пример #1
0
    public void SoundSliderChange()
    {
        FxCollection.PlayTextOverFx();
        float volume = m_sound_slider.value;

        GlobalManager.instance.soundVolumn = volume;
    }
Пример #2
0
 public void OnPointerClick(BaseEventData eventData)
 {
     FxCollection.PlayButtonClickFx();
     Debug.Log("指针点击");
     MenuManager.instance.SetMenuContent(drinkInfo);
     MenuManager.instance.FocusOnContent();
 }
Пример #3
0
    public void AudioSliderChange()
    {
        FxCollection.PlayTextOverFx();
        float volume = m_audio_slider.value;

        GlobalManager.instance.audioVolumn = volume;
        musicSource.volume = volume;
    }
Пример #4
0
 public void OnPointerClick(BaseEventData eventData)
 {
     FxCollection.PlayButtonClickFx();
     Debug.Log("指针单击");
     GroupSelected();
     buttonBack.color          = vecClick;
     itemManager.itemBoardType = (ItemManager.ItemBoardEnum)buttonId;
     itemManager.RenewItemBoard();
 }
Пример #5
0
 public void DrinkListOnClick()
 {
     FxCollection.PlayButtonClickFx();
     if (viewArea.active == false)
     {
         viewArea.SetActive(true);
     }
     else
     {
         viewArea.SetActive(false);
     }
 }
Пример #6
0
 public void CanvasLeftButton()
 {
     FxCollection.PlayButtonClickFx();
     if (screenResType != 0)
     {
         screenResType -= 1;
     }
     else
     {
         screenResType = 3;
     }
     screenResText.text = screenResStrArr[screenResType];
 }
Пример #7
0
 public void CanvasRightButton()
 {
     FxCollection.PlayButtonClickFx();
     if (screenResType != 3)
     {
         screenResType += 1;
     }
     else
     {
         screenResType = 0;
     }
     screenResText.text = screenResStrArr[screenResType];
 }
Пример #8
0
 // Update is called once per frame
 void Update()
 {
     if (!isUIViewed)
     {
         if (Input.GetKeyUp(KeyCode.Mouse0))
         {
             FxCollection.PlayButtonEnterFx();
             UIGetIn();
             pressToStart.SetActive(false);
             isUIViewed = true;
         }
     }
 }
Пример #9
0
    public void SettingOnClick()
    {
        FxCollection.PlayButtonClickFx();
        GameObject settingArea = GlobalManager.instance.SettingArea;

        if (settingArea.active == false)
        {
            settingArea.SetActive(true);
        }
        else
        {
            settingArea.SetActive(false);
        }
    }
Пример #10
0
 public void MixClearOnClick()
 {
     FxCollection.PlayLowFx();
     foreach (ItemData item in DrinkData.instance.itemSelectedList)
     {
         item.itemNumber = 0;
     }
     foreach (AmountCacul item in ItemManager.instance.amountCaculArr)
     {
         item.ClearData();
     }
     DrinkData.instance.itemSelectedList.Clear();
     liquidImageRect.sizeDelta = new Vector2(liquidImageRect.rect.width, 0);
 }
Пример #11
0
 public void OnPointerDown(BaseEventData eventData)
 {
     if (!isAllowDrag)
     {
         return;
     }
     //Debug.Log("被点击了");
     //Debug.Log("鼠标位置:" + Input.mousePosition);
     //Debug.Log("localPosition:" + m_rect.localPosition);
     //Debug.Log("anchoredPosition:" + m_rect.anchoredPosition);
     //Debug.Log("Position:" + m_rect.position);
     FxCollection.PlayLowFx();
     m_image.color     = ColorCollection.GetVecNormal();
     m_rect.localScale = smallScale;
     mouseOriginPos    = Input.mousePosition;
 }
Пример #12
0
 void OnTriggerExit2D(Collider2D collider)
 {
     m_outline.enabled = false;
     if (collider != null)
     {
         if (!Input.GetMouseButton(0) && !liquidImage.IsCupFull())
         {
             FxCollection.PlayButtonUpFx();
             CraftItem craftItem = collider.gameObject.GetComponent <CraftItemCollider>().bindItem;
             foreach (AmountCacul item in ItemManager.instance.amountCaculArr)
             {
                 if (item.bindItem == craftItem)
                 {
                     item.AddOnClick();
                 }
             }
         }
         Debug.Log("接触结束");
     }
 }
Пример #13
0
 public void LoadClick(BaseEventData e)
 {
     FxCollection.PlayButtonClickFx();
 }
Пример #14
0
 public void PushClearOnClick()
 {
     FxCollection.PlayLowFx();
 }
Пример #15
0
 public void MakeClearOnClick()
 {
     FxCollection.PlayLowFx();
     makeDrink.ClearData();
 }
Пример #16
0
 public void StartGameClick(BaseEventData e)
 {
     FxCollection.PlayButtonClickFx();
     GlobalManager.instance.StartGame();
 }
Пример #17
0
 public void ChangeScreenOnClick()
 {
     FxCollection.PlayButtonClickFx();
     GlobalManager.instance.screenResType = screenResType;
     ChangeScreenResolution(GlobalManager.instance.screenResType);
 }
Пример #18
0
    public void OnClick()
    {
        if (!isAllowClick)
        {
            return;
        }
        if (!isDrinkReady)
        {
            if (DrinkData.instance.itemSelectedList.Count == 0)
            {
                return;
            }
            FxCollection.PlayButtonClickFx();
            //制作饮料
            drinkInst = new DrinkInst();

            drinkManager.gameObject.SetActive(true);
            drinkManager.ChangeBack(drinkInst.qualityType);
            drinkManager.ShowNewDrink(drinkInst);

            string imagePath = "Sprites/Drinks/" + drinkInst.drinkName;
            UICollection.SetImage(imagePath, cupImage);

            isDrinkReady    = true;
            buttonText.text = giveStr;
        }
        else
        {
            FxCollection.PlayButtonEnterFx();
            //分支数
            int optionNumber = dataArr.Length - 4;
            Debug.Log("饮料分支数量:" + optionNumber);

            List <string> branchDrinkNames = new List <string>();
            for (int i = 0; i < optionNumber; i++)
            {
                string[] dataCell = dataArr[4 + i].Trim().Substring(1).Split('\"');
                branchDrinkNames.Add(dataCell[0]);
            }
            //在脚本中的所有关键饮料分支中寻找与当前饮料名匹配的分支
            int targetIndex     = -1;
            int errorIndex      = -1;
            int injectRowNumber = 0;
            for (int i = 0; i < branchDrinkNames.Count; i++)
            {
                if (branchDrinkNames[i] == "不可名状")
                {
                    errorIndex = i;
                }
                if (drinkInst.drinkName == branchDrinkNames[i])
                {
                    injectRowNumber = InjectText();
                    targetIndex     = i;
                    break;
                }
                else
                {
                    //饮料不在分支中的情况
                    targetIndex = errorIndex;
                }
            }
            Debug.Log("targetIndex:" + targetIndex);
            //将所有分支对话数据分解,存入列表
            List <string[]> optionData = new List <string[]>();
            for (int i = 0; i < optionNumber; i++)
            {
                string[] dataCell = dataArr[4 + i].Trim().Substring(1).Split('\"');
                if (injectRowNumber != 0 && i == targetIndex)
                {
                    int originRowNumber = int.Parse(dataCell[1]);
                    int newRowNumber    = originRowNumber + injectRowNumber;
                    dataCell[1] = newRowNumber.ToString();
                }
                optionData.Add(dataCell);
            }
            toolsManager.ManageBranch(optionData, targetIndex);
            isDrinkReady    = false;
            buttonText.text = makeStr;

            toolsManager.HiddenToolsBoard();

            GameObject.Find("LiquidImage").GetComponent <LiquidImage>().EmptyCup();

            Sprite spr = originCupSpr;
            UICollection.SetImage(spr, cupImage);

            GameObject viewArea = GameObject.Find("TalkArea").GetComponent <TalkArea>().viewArea;
            if (viewArea.active)
            {
                viewArea.SetActive(false);
            }
        }
    }
Пример #19
0
 public void OnPointerEnter(BaseEventData eventData)
 {
     //Debug.Log("指针进入");
     FxCollection.PlayButtonEnterFx();
 }
Пример #20
0
 public void ReturnMainOnClick()
 {
     FxCollection.PlayButtonClickFx();
     GlobalManager.SaveData();
     SceneManager.LoadScene("MenuScene");
 }
Пример #21
0
    private IEnumerator ShowText(string text)
    {
        text = text.Trim();
        text = text.Substring(1, text.Length - 2);
        text = "『" + text + "』";
        //i为当前显示字符长度
        int    i           = 0;
        int    strLength   = text.Length;
        string colHeadStr  = "";
        bool   isStringCol = false;

        IsPlayingText = true;
        showStr       = "";

        while (i < strLength)
        {
            //识别并不显示颜色代码
            if (text[i].ToString() == "<" && text[i + 1].ToString() != "/")
            {
                isStringCol = true;
                int j = 1;
                while (text[i + j].ToString() != ">")
                {
                    j++;
                }
                colHeadStr = text.Substring(i, j + 1);
                i         += j + 1;
            }
            else if (text[i].ToString() == "<" && text[i + 1].ToString() == "/")
            {
                i          += 8;
                isStringCol = false;
            }

            //向显示字符中添加新字符
            if (isStringCol)
            {
                showStr += colHeadStr + text[i].ToString() + "</color>";
            }
            else if (text[i] == '\\')
            {
                //忽略转行
                showStr += '\n';
                i++;
            }
            else
            {
                showStr += text[i].ToString();
            }
            //播放音效
            if (i % 2 == 0)
            {
                FxCollection.PlayTextFx();
            }
            //更新当前文字
            talkText.text = showStr;
            //识别换行
            talkText.text = talkText.text.Replace("\\n", "\n");
            i++;
            yield return(new WaitForSeconds(textSpeed));
        }
        FxCollection.PlayTextOverFx();
        rowIndex++;
        IsPlayingText = false;
        StopCoroutine("ShowText");
    }
Пример #22
0
 public void CreatorClick(BaseEventData e)
 {
     FxCollection.PlayButtonClickFx();
 }
Пример #23
0
 public void OnPointerClickSub(BaseEventData eventData)
 {
     FxCollection.PlayButtonUpFx();
     SubOnClick();
 }
Пример #24
0
 public void ReturnButtonOnClick()
 {
     FxCollection.PlayButtonClickFx();
     FocusOnMain();
 }
Пример #25
0
 public void OnPointerClick(BaseEventData eventData)
 {
     FxCollection.PlayButtonClickFx();
     Debug.Log("指针点击");
     MenuManager.instance.RenderMenuByTag(tag);
 }
Пример #26
0
 public void PointEnter(BaseEventData e)
 {
     FxCollection.PlayButtonEnterFx();
     ChangeImage(enterSpr);
     GameObject.Find("FunArea").GetComponent <FunAreaControl>().ChangeContent(markNum);
 }
Пример #27
0
 public void ReturnOnClick()
 {
     FxCollection.PlayButtonClickFx();
     gameObject.SetActive(false);
 }
Пример #28
0
 public void OnPointerExit(BaseEventData eventData)
 {
     FxCollection.PlayButtonUpFx();
     //Debug.Log("指针离开");
 }
Пример #29
0
 public void OnPointerClickAdd(BaseEventData eventData)
 {
     FxCollection.PlayButtonEnterFx();
     AddOnClick();
 }
Пример #30
0
 public void SettingClick(BaseEventData e)
 {
     FxCollection.PlayButtonClickFx();
     GlobalManager.instance.SettingArea.SetActive(true);
 }