예제 #1
0
    IEnumerator DownloadAllPhotos()
    {
        var           stringBase = "https://armuseum.ml/uploads/photo/dragndrop/MuzeuldeStiinta/";
        WebRequest    request    = WebRequest.Create(stringBase);
        WebResponse   response   = request.GetResponse();
        Regex         regex      = new Regex("<a href=\".*\">(?<name>.*.jpg)</a>");
        List <string> photos     = new List <string>();

        using (var reader = new StreamReader(response.GetResponseStream()))
        {
            string result = reader.ReadToEnd();

            MatchCollection matches = regex.Matches(result);
            if (matches.Count == 0)
            {
                Debug.Log("parse failed.");
            }

            foreach (Match match in matches)
            {
                if (!match.Success)
                {
                    continue;
                }

                photos.Add((match.Groups["name"]).ToString());
                Debug.Log(photos[photos.Count - 1]);
            }
        }


        DiskPaths = new List <string>();
        int j = 0;

        foreach (var i in photos)
        {
            if (j % 4 == 0)
            {
                text.GetComponentInChildren <TextMeshProUGUI>().text = "Loading";
            }
            else
            {
                text.GetComponentInChildren <TextMeshProUGUI>().text = text.GetComponentInChildren <TextMeshProUGUI>().text + ".";
            }
            var baseName = $"{i}"; j++;
            Manager.names.Add($"{i}");;
            Debug.Log($"{i}");
            var diskPath = $"{Application.persistentDataPath}/{baseName}";
            DiskPaths.Add(diskPath);
            yield return(DownloadData($"{stringBase}/{baseName}", diskPath));
        }
    }
예제 #2
0
 public void suta()               //説明モードが選ばれた時に動くやーつ
 {
     gamebotab1.SetActive(false); //モードボタン消しておく
     gamebotab2.SetActive(false);
     gamebotab3.SetActive(false);
     moya.SetActive(true); //もやもやを出す
     page = 1;             //最初は1ページ目から
     serif.GetComponentInChildren <TextMeshProUGUI>().text = "このゲームはカードを選んで生き残る\nサバイバルゲームです\n\nあなたはカード選んでその日の\n最善の行動を取ってください\n\nでも結局は運";
     //壱ページ目の内容を入れておく
     StartCoroutine(fadeout());  //最初専用フェードコルーチンの呼び出し
 }
예제 #3
0
 public void OpcaoAbandonar()
 {
     OpcaoJogarFora = Instantiate(Opcao, Vector3.zero, Quaternion.identity);
     OpcaoJogarFora.GetComponentInChildren <TextMeshProUGUI>().text = "Abandonar";
     OpcaoJogarFora.transform.SetParent(ItemOpcoes.transform);
     OpcaoJogarFora.GetComponent <Opcao>().ItemReferencia = this.gameObject;
 }
예제 #4
0
        private void Awake()
        {
            NullChecks();

            labelBackground = (RectTransform)cursorLabel.GetComponentInChildren <Image>().transform;

            ToggleCursor(false);

            formatString = "({0:F" + lineGraph.XPrecision + "}, {1:F" + lineGraph.YPrecision + "})";

            void NullChecks()
            {
                if (lineGraph == null)
                {
                    lineGraph = GetComponentInParent <LineGrapher>();
                    if (lineGraph == null)
                    {
                        Debug.LogError("LineGraphCursor not attached to LineGrapher");
                        Destroy(this);
                    }
                }
                if (xCursor == null || yCursor == null || cursor == null)
                {
                    Debug.LogError("No cursor(s) missing.");
                    Destroy(this);
                }

                if (cursorLabel == null && showLabel)
                {
                    Debug.LogError("No text label found for cursor. Attach text or disable showLabel");
                    Destroy(this);
                }
            }
        }
예제 #5
0
    // ////////////////////////////////////////////////////////
    // Text Processing Functions
    // --------------------------------------------------------
    public static IEnumerator ThisFunctionIsOnlyForGGJ(float fadeTime, TextMeshProUGUI text, List <string> whatIsay, float delayTime, float timeTextIn, float timeTextOut)
    {
        yield return(new WaitForSeconds(delayTime));

        if (!text.gameObject.activeSelf)
        {
            text.gameObject.SetActive(true);
        }

        for (int i = 0; i < whatIsay.Count; i++)
        {
            text.GetComponentInChildren <VertexJitter>().ShakeText();
            text.color = new Color(text.color.r, text.color.g, text.color.b, 0f);
            text.text  = whatIsay[i];

            while (text.color.a < 1f)
            {
                text.color = new Color(text.color.r, text.color.g, text.color.b, text.color.a + (Time.deltaTime / fadeTime));
                yield return(null);
            }

            yield return(new WaitForSeconds(timeTextIn));

            while (text.color.a > 0f)
            {
                text.color = new Color(text.color.r, text.color.g, text.color.b, text.color.a - (Time.deltaTime / fadeTime));
                yield return(null);
            }

            yield return(new WaitForSeconds(timeTextOut));
        }
    }
예제 #6
0
    IEnumerator DisplayDamageRoutine(int damage)
    {
        damagePreviewText.text     = damage.ToString();
        damagePreviewText.fontSize = 40;
        damagePreviewText.gameObject.SetActive(true);

        while (damagePreviewText.fontSize < 60)
        {
            damagePreviewText.fontSize += 1.25f;
            yield return(new WaitForSeconds(0.05f));
        }

        yield return(new WaitForSeconds(0.3f));

        damagePreviewText.gameObject.SetActive(false);
        damagePreviewText.fontSize = 30;

        var actualDamageText = DamageDisplay.GetComponentInChildren <TextMeshProUGUI>();
        int currentDamage    = 0;

        if (!string.IsNullOrEmpty(actualDamageText.text.Trim()))
        {
            currentDamage = int.Parse(actualDamageText.text.Trim());
        }

        actualDamageText.text = (currentDamage + damage).ToString();
    }
예제 #7
0
 public void mainaus()//パラメーター反映
 {
     sute1.GetComponentInChildren <TextMeshProUGUI>().text = para1.ToString();
     sute2.GetComponentInChildren <TextMeshProUGUI>().text = para2.ToString();
     sute3.GetComponentInChildren <TextMeshProUGUI>().text = para3.ToString();
     sute4.GetComponentInChildren <TextMeshProUGUI>().text = para4.ToString();
     sute5.GetComponentInChildren <TextMeshProUGUI>().text = para5.ToString();
     iro();
 }
예제 #8
0
 void OutputValues()
 {
     nutrientOutputStr = nutrientValueStr + nutrientUnitStr + " of added sugar";
     outputLabel.GetComponentInChildren <TextMeshProUGUI>().text = nutrientOutputStr;
     dvOutputStr = dvInt + dvSuffix;
     if (outputDV != null)
     {
         outputDV.GetComponentInChildren <TextMeshProUGUI>().text = dvOutputStr;
     }
 }
예제 #9
0
 public void daystart()                                                            //1日の始まりに実行
 {
     StartCoroutine(fadeout());                                                    //フェードアウトの実行、及びフェード中の処理
     if (endret == 0)                                                              //無限モードか判断
     {
         if (deyi == 10)                                                           //10日目か判断
         {
             endf = 1;                                                             //終了フラグを立てる
             day.GetComponentInChildren <TextMeshProUGUI>().text = "-GAME CLEAR-"; //日付をゲームクリアに変える
         }
         else                                                                      //10日前だったら続行
         {
             deyi++;                                                               //日付の更新
             day.GetComponentInChildren <TextMeshProUGUI>().text = deyi + "日目";    //テキストの日付の更新
         }
     }
     else if (endret == 1)                                                  //無限モードだったら
     {
         deyi++;                                                            //日付の更新
         day.GetComponentInChildren <TextMeshProUGUI>().text = deyi + "日目"; //テキストの日付の更新
     }
 }
예제 #10
0
 void Start()
 {
     if (GameSetting.ThisRound == 1)
     {
         for (int i = 0; i < GameSetting.NumberOfPlayers; i++)
         {
             TotalPercent[i] = 0;
             TotalPoints[i]  = 0;
         }
     }
     Bars = FreeDraw.Drawable.Bars;
     GetTotalPoints();
     for (int i = 0; i < GameSetting.NumberOfPlayers; i++)
     {
         int j = Bars[i].GetComponentInChildren <Bar>().ind;
         if (GameSetting.NumberOfPlayers <= 4)
         {
             pos = new Vector3(960, 760 - 80 * i, 0);
         }
         else
         {
             if ((i % 2) == 0)
             {
                 pos = new Vector3(810, 760 - 40 * i, 0);
             }
             else
             {
                 pos = new Vector3(1110, 760 - 40 * i, 0);
             }
         }
         L = Instantiate(Line, pos, Quaternion.identity, transform);
         L.GetComponentInChildren <Image>().color = GameSetting.PlayerColors[j];// Bars[i].GetComponentInChildren<Image>().color;
         L.text = TotalPoints[j] + " pts" + "   " + System.Math.Round(100.0 * TotalPercent[j]) + "%";
     }
     if (GameSetting.ThisRound == GameSetting.NumberOfRounds)
     {
         RoundCounter.text = "End of game";
         GameObject.Find("PlayButton").SetActive(false); //Do not use names.
     }
     else
     {
         RoundCounter.text = "End of round " + GameSetting.ThisRound;
     }
     GameSetting.ThisRound++;
 }
예제 #11
0
    public void ClicouItem()
    {
        tempControleInventario.ItemSelecionadoDentroInventario = this.gameObject;

        if (TipoItem == "Pocao")
        {
            AbrirOpcao();

            OpcaoUsar = Instantiate(Opcao, Vector3.zero, Quaternion.identity);
            OpcaoUsar.GetComponentInChildren <TextMeshProUGUI>().text = "Usar";
            OpcaoUsar.transform.SetParent(ItemOpcoes.transform);
            OpcaoUsar.GetComponent <Opcao>().ItemReferencia = this.gameObject;

            OpcaoAbandonar();
        }

        if (TipoItem == "Arma")
        {
            //Quando Arma nao estiver equipada
            if (!Equipado)
            {
                AbrirOpcao();

                OpcaoJogarFora = Instantiate(Opcao, Vector3.zero, Quaternion.identity);
                OpcaoJogarFora.GetComponentInChildren <TextMeshProUGUI>().text = "Equipar";
                OpcaoJogarFora.transform.SetParent(ItemOpcoes.transform);
                OpcaoJogarFora.GetComponent <Opcao>().ItemReferencia = this.gameObject;

                OpcaoAbandonar();
            }
            else
            {
                //Quando Arma Estiver Equipada
                AbrirOpcao();

                OpcaoJogarFora = Instantiate(Opcao, Vector3.zero, Quaternion.identity);
                OpcaoJogarFora.GetComponentInChildren <TextMeshProUGUI>().text = "Desequipar";
                OpcaoJogarFora.transform.SetParent(ItemOpcoes.transform);
                OpcaoJogarFora.GetComponent <Opcao>().ItemReferencia = this.gameObject;

                OpcaoAbandonar();
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (wrench.GetComponent <CapsuleCollider2D>().enabled == false)
        {
            wrenchText.faceColor = new Color32(200, 200, 200, 255);
            wrenchText.GetComponentInChildren <SpriteRenderer>().color = new Color32(200, 200, 200, 70);
        }
        if (wrench.GetComponent <CapsuleCollider2D>().enabled == true)
        {
            wrenchText.faceColor = new Color32(255, 0, 0, 255);
            wrenchText.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 55, 255, 255);
        }

        if (temp.GetComponent <CapsuleCollider2D>().enabled == false)
        {
            tempText.faceColor = new Color32(200, 200, 200, 255);
            tempText.GetComponentInChildren <SpriteRenderer>().color = new Color32(200, 200, 200, 70);
        }
        if (temp.GetComponent <CapsuleCollider2D>().enabled == true)
        {
            tempText.faceColor = new Color32(255, 0, 0, 255);
            tempText.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 55, 255, 255);
        }

        if (welder.GetComponent <CapsuleCollider2D>().enabled == false)
        {
            welderText.faceColor = new Color32(200, 200, 200, 255);
            welderText.GetComponentInChildren <SpriteRenderer>().color = new Color32(200, 200, 200, 70);
        }
        if (welder.GetComponent <CapsuleCollider2D>().enabled == true)
        {
            welderText.faceColor = new Color32(255, 0, 0, 255);
            welderText.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 55, 255, 255);
        }

        if (bigGuy.GetComponent <CapsuleCollider2D>().enabled == false)
        {
            bigGuyText.faceColor = new Color32(200, 200, 200, 255);
            bigGuyText.GetComponentInChildren <SpriteRenderer>().color = new Color32(200, 200, 200, 70);
        }
        if (bigGuy.GetComponent <CapsuleCollider2D>().enabled == true)
        {
            bigGuyText.faceColor = new Color32(255, 0, 0, 255);
            bigGuyText.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 55, 255, 255);
        }
        if (data.GetComponent <CapsuleCollider2D>().enabled == false)
        {
            dataText.faceColor = new Color32(200, 200, 200, 255);
            dataText.GetComponentInChildren <SpriteRenderer>().color = new Color32(200, 200, 200, 70);
        }
        if (data.GetComponent <CapsuleCollider2D>().enabled == true)
        {
            dataText.faceColor = new Color32(255, 0, 0, 255);
            dataText.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 55, 255, 255);
        }

        if (accounting.GetComponent <CapsuleCollider2D>().enabled == false)
        {
            accountingText.faceColor = new Color32(200, 200, 200, 255);
            accountingText.GetComponentInChildren <SpriteRenderer>().color = new Color32(200, 200, 200, 70);
        }
        if (accounting.GetComponent <CapsuleCollider2D>().enabled == true)
        {
            accountingText.faceColor = new Color32(255, 0, 0, 255);
            accountingText.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 55, 255, 255);
        }

        if (manager.GetComponent <CapsuleCollider2D>().enabled == false)
        {
            managerText.faceColor = new Color32(200, 200, 200, 255);
            managerText.GetComponentInChildren <SpriteRenderer>().color = new Color32(200, 200, 200, 70);
        }
        if (manager.GetComponent <CapsuleCollider2D>().enabled == true)
        {
            managerText.faceColor = new Color32(255, 0, 0, 255);
            managerText.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 55, 255, 255);
        }
    }
 private void RemoveSkipListener()
 {
     currentTextUI.GetComponentInChildren <Button>().onClick.RemoveAllListeners();
 }
예제 #14
0
        public override void HandleFluentNode(FluentNode fluentNode)
        {
            // Store current node
            currentNode = fluentNode as WriteNode;

            // Check if the UI element is defined on the node itself
            if (currentNode.TextUIElement != null)
            {
                currentTextUI = currentNode.TextUIElement;
            }
            else
            {
                TextUI = GameObject.Find("/GameManager/DialogueBox/Dialog With Response/Scroll View/Viewport/ScrollablePanel/WriteText").GetComponent <TextMeshProUGUI>();
            }
            currentTextUI = TextUI;

            // Get the text component we are using to write the text
            TextMeshProUGUI textTextUI = currentTextUI;

            textTextUI.maxVisibleCharacters = 0;

            if (!(currentTextUI.gameObject).activeSelf)
            {
                Debug.LogError("Did you forget to call Show() before Write() in your node chain ? The Write Node needs the element on to which text is written to be visible", this);
                return;
            }

            // Add a button to the text if it doesnt have one
            if (currentTextUI.GetComponentInChildren <Button>() == null)
            {
                currentTextUI.gameObject.AddComponent <Button>();
            }

            // Add the button listener so that text can be skipped
            currentTextUI.GetComponentInChildren <Button>().onClick.RemoveAllListeners();
            currentTextUI.GetComponentInChildren <Button>().onClick.AddListener(new UnityEngine.Events.UnityAction(() =>
            {
                // Do cleanup
                isTyping = false;
                StopCoroutine("TypeText");
                StopCoroutine("Pause");
                string nodeText = textTextUI.text;
                textTextUI.text = nodeText;
                textTextUI.maxVisibleCharacters = nodeText.Length;
                RemoveSkipListener();

                // Write's that require a button press to continue cannot be interrupted
                if (currentNode.WaitForButtonPress)
                {
                    ShowButton();
                    return;
                }

                FluentNode prevNode = currentNode;
                currentNode.Done();
                prevNode.IWasInterrupted();
            }));

            // Set the text component to be the selected component
            EventSystem.current.SetSelectedGameObject(textTextUI.gameObject);

            // Check if this is an instant write
            if (CharacterPauseSeconds == 0)
            {
                string nodeText = currentNode.Text;
                textTextUI.maxVisibleCharacters = nodeText.Length;
                textTextUI.text = currentNode.Text;
                if (currentNode.SecondsToPause != 0)
                {
                    StartCoroutine("Pause");
                }
                else
                {
                    currentNode.Done();
                }

                return;
            }

            StartCoroutine("TypeText");
        }
예제 #15
0
 protected void Init()
 {
     backgroundlayout = background.GetComponent <VerticalLayoutGroup>();
     backgroundSize   = background.GetComponent <ContentSizeFitter>();
     textSize         = text.GetComponentInChildren <ContentSizeFitter>();
 }
예제 #16
0
 public void sen1()
 {
     SE.play(2);
     a      = 1;
     cardNo = 1;
     moya.SetActive(true);
     gado.SetActive(true);
     serif.GetComponentInChildren <TextMeshProUGUI>().text = "あなたは木箱を見つけました\nその中に食べ物を見つけました\nそれを持ち帰ります";
 }
 public void Awake()
 {
     backgroundlayout = GetComponent <VerticalLayoutGroup>();
     backgroundSize   = GetComponent <ContentSizeFitter>();
     textSize         = choiceText.GetComponentInChildren <ContentSizeFitter>();
 }
예제 #18
0
    // Start is called before the first frame update
    void Update()
    {
        if (sukoa >= 500)
        {
            if (level == 2)
            {
                lv.GetComponentInChildren <TextMeshProUGUI>().text = level + "";
                my.GetComponent <control>().level2();
                level++;
            }
        }

        if (sukoa >= 1000)
        {
            if (level == 3)
            {
                lv.GetComponentInChildren <TextMeshProUGUI>().text = level + "";
                my.GetComponent <jump>().level3();
                level++;
            }
        }

        if (sukoa >= 3000)
        {
            if (level == 4)
            {
                bgm.Stop();
                bgm.Play(1);
                lv.GetComponentInChildren <TextMeshProUGUI>().text = level + "";
                my.GetComponent <jump>().level4();
                level++;
            }
        }

        if (sukoa >= 5000)
        {
            if (level == 5)
            {
                lv.GetComponentInChildren <TextMeshProUGUI>().text = level + "";
                my.GetComponent <control>().level5();
                level++;
            }
        }

        if (sukoa >= 7500)
        {
            if (level == 6)
            {
                lv.GetComponentInChildren <TextMeshProUGUI>().text = level + "";
                my.GetComponent <jump>().level6();
                level++;
            }
        }

        if (sukoa >= 10000)
        {
            if (level == 7)
            {
                bgm.Stop();
                bgm.Play(2);
                lv.text = "MAX";
                my.GetComponent <jump>().level7();
                level++;
            }
        }
    }
예제 #19
0
        public void SetContent(MoreSongsFlowCoordinator sender, Song newSongInfo)
        {
            selectedCharacteristic = null;
            currentDifficulties    = null;
            _currentSong           = newSongInfo;

            songNameText.text = _currentSong.songName;
            if (_characteristicSegmentedDisplay == null)
            {
                _characteristicSegmentedDisplay = BeatSaberUI.CreateIconSegmentedControl(rectTransform, new Vector2(-40, .2f), new Vector2(70, 9f),
                                                                                         delegate(int value) { SelectedCharacteristic(_currentSong.metadata.characteristics[value]); });
                SetupCharacteristicDisplay(_characteristicSegmentedDisplay, _currentSong);
            }
            else
            {
                SetupCharacteristicDisplay(_characteristicSegmentedDisplay, _currentSong);
            }



            if (_difficultySegmentedDisplay == null)
            {
                _difficultySegmentedDisplay = BeatSaberUI.CreateTextSegmentedControl(rectTransform, new Vector2(-40, -9f), new Vector2(85, 8f),
                                                                                     delegate(int value) { SelectedDifficulty(currentDifficulties[value]); });
                _difficultySegmentedDisplay.transform.localScale = new Vector3(.8f,
                                                                               _difficultySegmentedDisplay.transform.localScale.y, _difficultySegmentedDisplay.transform.localScale.z);
                SetupDifficultyDisplay(_difficultySegmentedDisplay, _currentSong);
            }
            else
            {
                SetupDifficultyDisplay(_difficultySegmentedDisplay, _currentSong);
            }

            downloadsText.text          = _currentSong.downloads.ToString();
            _levelParams.bpm            = (float)(_currentSong.plays);
            _levelParams.notesCount     = (int)_currentSong.bpm;
            _levelParams.obstaclesCount = _currentSong.upVotes;
            _levelParams.bombsCount     = _currentSong.downVotes;

            Polyglot.LocalizedTextMeshProUGUI localizer1 = difficulty1Title.GetComponentInChildren <Polyglot.LocalizedTextMeshProUGUI>();
            if (localizer1 != null)
            {
                GameObject.Destroy(localizer1);
            }
            Polyglot.LocalizedTextMeshProUGUI localizer2 = difficulty2Title.GetComponentInChildren <Polyglot.LocalizedTextMeshProUGUI>();
            if (localizer2 != null)
            {
                GameObject.Destroy(localizer2);
            }
            Polyglot.LocalizedTextMeshProUGUI localizer3 = difficulty3Title.GetComponentInChildren <Polyglot.LocalizedTextMeshProUGUI>();
            if (localizer3 != null)
            {
                GameObject.Destroy(localizer3);
            }
            difficulty1Title.text = "";
            difficulty2Title.text = "";
            difficulty3Title.text = "";
            difficulty1Text.text  = "";
            difficulty2Text.text  = "";
            difficulty3Text.text  = "";



            //       difficulty1Text.text = (_currentSong.metadata.difficulties.expert || _currentSong.metadata.difficulties.expertPlus) ? "Yes" : "No";
            //       difficulty2Text.text = (_currentSong.metadata.difficulties.hard) ? "Yes" : "No";
            //       difficulty3Text.text = (_currentSong.metadata.difficulties.easy || _currentSong.metadata.difficulties.normal) ? "Yes" : "No";

            StartCoroutine(LoadScripts.LoadSpriteCoroutine(_currentSong.coverURL, (cover) => { coverImage.texture = cover.texture; }));

            SetFavoriteState(PluginConfig.favoriteSongs.Any(x => x.Contains(_currentSong.hash)));
            SetDownloadState((SongDownloader.Instance.IsSongDownloaded(_currentSong) ? DownloadState.Downloaded : (sender.IsDownloadingSong(_currentSong) ? DownloadState.Downloading : DownloadState.NotDownloaded)));
            SetLoadingState(false);


            SelectedCharacteristic(_currentSong.metadata.characteristics[0]);
        }
예제 #20
0
 public void apple()
 {
     sukoa += 1000;
     ui.GetComponentInChildren <TextMeshProUGUI>().text = sukoa + "";
 }
예제 #21
0
 public void setumei1()
 {
     SE.play(2);
     moya2.SetActive(true);
     b = 1;
     serif.GetComponentInChildren <TextMeshProUGUI>().text = "食べ物がくさりました\nもう食べることはできません";
 }