public void SetDialog(string dialog)
    {
        dialogs = dialog.Split('$').ToList();
        textLabel.SetText(dialogs.FirstOrDefault());

        nextAction = System.DateTime.Now.AddMilliseconds(Constants.INTERACTION_DELAY_IN_MS);
    }
    public IEnumerator ShowTextDuration(string _text, float _time)
    {
        text.SetText(_text);
        yield return(new WaitForSeconds(_time));

        text.SetText("");
    }
    private IEnumerator DelayToStart()
    {
        float timer = delayToStartSeconds;

        startCounter.SetText(timer.ToString());
        float timeUpdate = Time.time;

        while (timer > 0)
        {
            startCounter.fontSize = counterTextSize * (1 - (Time.time - timeUpdate));
            if ((Time.time - timeUpdate) >= 1)
            {
                timer     -= 1;
                timeUpdate = Time.time;
                startCounter.SetText(timer.ToString());
            }

            yield return(null);
        }

        state = State.Play;

        startCounter.gameObject.SetActive(false);
        // CheckTime();
    }
示例#4
0
 public void ResetConfigs()
 {
     m_logTMP.SetText("ResetConfigs");
     m_data = new SettingDataA(0, 0);
     m_languageDropDownItem.SetData((int)m_data.Language);
     m_volumeItem.SetData(m_data.Volume);
 }
示例#5
0
    // Change popup text depending on situation
    void UpdatePopUp()
    {
        switch (currInteractableObjType)
        {
        // If interactable type is loot
        case InteractableObject.InteractableType.Loot: {
            // If player is holding loot
            if (isHoldingLoot)
            {
                popupText.color = Localization.COLOR_DISABLED;
                popupText.SetText(Localization.Translate("POPUP_TAKE_LOOT_TO_SPAWN"));
                // Else if player is not holding loot
            }
            else
            {
                popupText.color = Localization.COLOR_INFORMATION;
                popupText.SetText(Localization.Translate("POPUP_HOLD_TO_LOOT"));
            }
            break;
        }

        // If interactable type is switch
        case InteractableObject.InteractableType.Switch: {
            popupText.color = Localization.COLOR_INFORMATION;
            popupText.SetText(Localization.Translate("POPUP_HOLD_TO_SWITCH"));
            break;
        }
        }
    }
    void Start()
    {
#if UNITY_IPHONE && !UNITY_EDITOR
        _CameraDeviceInitialize();

        minExposureTargetBias = _CameraDeviceGetMinExposureTargetBias();
        maxExposureTargetBias = _CameraDeviceGetMaxExposureTargetBias();
#else
        minExposureTargetBias = 0.0f;
        maxExposureTargetBias = 1.0f;
#endif

        exposureValueSlider.minValue = minExposureTargetBias;
        exposureValueSlider.maxValue = maxExposureTargetBias;

#if UNITY_IPHONE && !UNITY_EDITOR
        float exposureTargetBias = _CameraDeviceGetExposureTargetBias();
        exposureValueSlider.value = exposureTargetBias;
#else
        exposureValueSlider.value = 0.0f;
#endif

        exposureValueSlider.onValueChanged.AddListener(delegate { SliderValueChangeCheck(); });
        exposureValueText.SetText("Exposure: " + exposureValueSlider.value.ToString());
    }
示例#7
0
 private void Start()
 {
     playerSword.OnEnemyKilled += PlayerSword_OnEnemyKilled;
     levelSystemAnimated.OnExperienceChanged += LevelSystemAnimated_OnExperienceChanged;
     levelSystemAnimated.OnLevelChanged      += LevelSystemAnimated_OnLevelChanged;
     levelText.SetText((levelSystemAnimated.GetLevelNumber() + 1).ToString());
 }
示例#8
0
 // Use this for initialization
 void Start()
 {
     winnerPanel.SetActive(true);
     idWinner = PlayerPrefs.GetInt("PlayerWinner");
     PlayerWinner.SetText("Player " + (idWinner + 1) + " wins !");
     setRanking();
 }
示例#9
0
    private void OnCollisionEnter(Collision collision)
    {
        string tag = collision.gameObject.tag;

        if (tag == "black")
        {
            GameObject.Destroy(gameObject);
        }


        if (tag == "green")
        {
            rigidbody.AddForce(transform.forward * accelerationLinear);
        }

        if (tag == "red")
        {
            red.Play();
            if (scene.name == "Main")
            {
                HP -= 5;
                if (HP < 0)
                {
                    HP = 0;
                }
                textHP.SetText(HP.ToString());
                rigidbody.AddForce(transform.forward * (-5) * accelerationLinear);
            }


            if (scene.name == "Level1")
            {
                for (int i = 0; i < 10; i++)
                {
                    collision.gameObject.transform.position -= new Vector3(0, 0.1f, 0) * Time.deltaTime;
                }
            }
        }

        if (tag == "obstacle")
        {
            fight.Play();
            rigidbody.AddForce(transform.forward * (-5) * accelerationLinear);
            HP -= 10;
            if (HP < 0)
            {
                HP = 0;
            }
            textHP.SetText(HP.ToString());
        }


        if (tag == "Finish")
        {
            string f = "FINISH";
            textState.SetText(f);
            PlayerDestroyedEvent.Invoke();
        }
    }
示例#10
0
    // #############################################
    // ##### METHODS

    // After getting enough money, return to escape zone to "win"
    private void ObjectiveComplete()
    {
        // Update text information on objective
        textMeshWorthTitle.SetText(Localization.Translate("UI_OBJECTIVE_COMPLETED"));
        textMeshWorthScore.SetText(Localization.Translate("UI_ESCAPE_READY"));
        // Turn escape object on
        escapeZoneObject.SetActive(true);
    }
 // Start is called before the first frame update
 void Start()
 {
     timer          = 100f;
     completionTime = timer;
     timerPause     = false;
     notPaused      = true;
     winMessage.SetText("");
 }
    internal void DisplayInstruction(bool activate, bool setInstruction)
    {
        if (setInstruction)
        {
            textMeshPro.SetText("Press R to talk");
        }

        playerDialogueBox.SetActive(activate);
    }
示例#13
0
    // Add in types here
    public void SetText(TalentSO _talent)
    {
        Vector2 localPoint;

        RectTransformUtility.ScreenPointToLocalPointInRectangle(container, Input.mousePosition, Camera.main, out localPoint);
        transform.localPosition = new Vector3(localPoint.x + width, localPoint.y - height, 1);

        image.enabled = true;
        name.SetText(_talent.name);
        string description = "";

        if (_talent.addedDamageFlat != 0)
        {
            description += "\nAdded Flat Damage: " + _talent.addedFlat;
        }
        if (_talent.dmgMulti != 0)
        {
            description += "\nDamage Multiplier: " + _talent.dmgMulti;
        }
        if (_talent.addedHealth != 0)
        {
            description += "\nAdded Flat Health: " + _talent.addedHealth;
        }
        if (_talent.healthMultiplier != 0)
        {
            description += "\nHealth Multiplier: " + _talent.healthMultiplier;
        }


        if (_talent.level == _talent.maxLevel)
        {
            desc.SetText(description);
            return;
        }

        description += "\n\nNext Level: ";
        if (_talent.GetNextLevel().addedDamageFlat != 0)
        {
            description += "\nAdded Flat Damage: " + _talent.GetNextLevel().addedFlat;
        }
        if (_talent.GetNextLevel().dmgMulti != 0)
        {
            description += "\nDamage Multiplier: " + _talent.GetNextLevel().dmgMulti;
        }
        if (_talent.GetNextLevel().addedHealth != 0)
        {
            description += "\nAdded Flat Health: " + _talent.GetNextLevel().addedHealth;
        }
        if (_talent.GetNextLevel().healthMultiplier != 0)
        {
            description += "\nHealth Multiplier: " + _talent.GetNextLevel().healthMultiplier;
        }



        desc.SetText(description);
    }
示例#14
0
    public void End()
    {
        end = true;
        cameraAnimator.SetTrigger("Victory");
        leftCarpe.Win();
        rightCarpe.Win();
        winScreen.SetActive(true);
        if (PlayerPrefs.HasKey(SceneManager.GetActiveScene().name))
        {
            var lastHighscore = PlayerPrefs.GetInt(SceneManager.GetActiveScene().name);
            if (scoreFloat > lastHighscore)
            {
                PlayerPrefs.SetInt(SceneManager.GetActiveScene().name, scoreFloat);
                PlayerPrefs.Save();
                newHighscore.SetActive(true);
                tapToExit.SetActive(false);
            }
        }

        else
        {
            PlayerPrefs.SetInt(SceneManager.GetActiveScene().name, scoreFloat);
            PlayerPrefs.Save();
            tapToExit.SetActive(false);
            newHighscore.SetActive(true);
        }

        highscoreString.SetText(PlayerPrefs.GetInt(SceneManager.GetActiveScene().name).ToString());
        scoreString.SetText(scoreFloat.ToString());

        if (percentageOfObstaclesPassed == 100)
        {
            rankString.SetText("S");
        }

        else if (percentageOfObstaclesPassed > 90)
        {
            rankString.SetText("A");
        }

        else if (percentageOfObstaclesPassed > 75)
        {
            rankString.SetText("B");
        }

        else if (percentageOfObstaclesPassed > 50)
        {
            rankString.SetText("C");
        }


        else if (percentageOfObstaclesPassed <= 50)
        {
            rankString.SetText("Nul");
        }
    }
示例#15
0
 private void Awake()
 {
     LostMenu.SetActive(false);
     WinningMenu.SetActive(false);
     CreateBallPlayerList();
     ReadLevel();
     Instance = this;
     PointsText.SetText(Points.ToString());
     RecordText.SetText(PlayerPrefs.GetInt("Score").ToString());
 }
示例#16
0
    public void OnShowText(DialogueSource source, Dialogue.Snippet snippet)
    {
        if (source != null)
        {
            Label.color = source.SubtitleColor;
        }

        Label.SetText(snippet.Render(source));
        Label.gameObject.SetActive(true);
    }
示例#17
0
    void FailSong()
    {
        StartTextGO.SetActive(false);
        GameHUDGO.SetActive(false);
        EndHUD.SetActive(true);

        isPlaying = false;

        finalScoreText.SetText(score.ToString("N0"));
        finalRatingText.SetText("You are lost...");
    }
示例#18
0
 private void UpdateHealthText()
 {
     if (player)
     {
         healthText.SetText(player.GetHealth().ToString());
     }
     else
     {
         healthText.SetText("0");
     }
 }
示例#19
0
    // Start is called before the first frame update
    void Start()
    {
        grid = FindObjectOfType <GenerateGrid>();

        number.SetText(numberofItems.ToString());
        if (numberofItems == 1)
        {
            decrease.interactable = false;
        }
        upgrade.Setnumber(numberofItems);
    }
示例#20
0
 // Update is called once per frame
 void Update()
 {
     if (comboHandler.ComboIsActive)
     {
         currentComboText.SetText(comboHandler.comboCount + "");
     }
     else
     {
         currentComboText.SetText("0");
     }
 }
示例#21
0
 // Use this for initialization
 void Start()
 {
     panels = new List <GameObject>(4);
     foreach (InputScheme s in schemes)
     {
         var p = Instantiate(s.PanelPrefab, this.transform);
         panels.Add(p);
         p.SetActive(false);
     }
     text.SetText(schemes[SelectedScheme].name);
     panels[SelectedScheme].SetActive(true);
 }
示例#22
0
 private void UpdateText()
 {
     if (item.IsStackable())
     {
         IStackableItem stackableItem = item as IStackableItem;
         text.SetText(stackableItem.GetAmount().ToString());
     }
     else
     {
         text.SetText("");
     }
 }
示例#23
0
    private void CharacterController_DieEvent(int team)
    {
        showDialogs = false;

        string text = "...>_<...";

        if (team == 1)
        {
            text = "this game sucks...";
        }

        dialogTextMesh.SetText(text);
    }
    void Start()
    {
        dominoPool = new GameObjectPool(dominoPrefab, "dominoPool");

        target        = GameObject.Instantiate(target);
        currentDomino = dominoPool.GetNext().transform;
        dominoes.Add(currentDomino.gameObject);

        highScore = PlayerPrefs.GetInt("HighScore", 0);
        highScoreText.SetText("" + highScore);

        speed = startSpeed;
    }
示例#25
0
 // Set mission state to success and display success screen
 public void SetMissionSuccess()
 {
     // Set "is post processing in phase of updating" to true
     isPPUpdating = true;
     // Reset pp interpolation timer
     ppInterpTimer = 0f;
     // Update results screen text
     textMeshHeader.SetText(Localization.Translate("RESULTS_MISSION_SUCCESSFUL"));
     textMeshSubheader.SetText(Localization.Translate("RESULTS_MISSION_SUCCESSFUL_SUB"));
     textMeshHeader.color = successfulMissionColor;
     // Set which PP setting is used to success
     whichPPSettingisSet = PPSettings.Success;
 }
示例#26
0
 // Start is called before the first frame update
 void Start()
 {
     _Streak.SetText(man.brain.streakCounter.ToString());
     _emotionSlider.value = man.brain.Love / man.brain.maxEmotion;
     if (man.brain.emotionStreakState)
     {
         _colorBox.color = Color.blue;
     }
     else
     {
         _colorBox.color = Color.red;
     }
 }
示例#27
0
    // Start is called before the first frame update
    void Start()
    {
        MyObjects    = new GameObject[4];
        MyObjects[0] = cube;
        MyObjects[1] = cube1;
        MyObjects[2] = cube2;
        MyObjects[3] = cube3;
        LevelSuccess = false;
        cube.GetComponentInChildren <Renderer>().material  = normalMat;
        cube1.GetComponentInChildren <Renderer>().material = normalMat;
        cube2.GetComponentInChildren <Renderer>().material = normalMat;
        cube3.GetComponentInChildren <Renderer>().material = normalMat;

        Nums  = new List <int>();
        Nums1 = new List <int>();
        Nums2 = new List <int>();
        Nums3 = new List <int>();

        canvasText = canvas.GetComponentInChildren <TMPro.TextMeshProUGUI>();
        panel.SetActive(false);
        canvasText.SetText("");
        //inp = GetComponent<InputField>();

        Nums1.Add(1);
        Nums1.Add(1);
        Nums1.Add(4);
        Nums1.Add(2);
        Nums1.Add(4);

        Nums2.Add(2);
        Nums2.Add(3);
        Nums2.Add(4);
        Nums2.Add(3);
        Nums2.Add(1);

        Nums3.Add(3);
        Nums3.Add(2);
        Nums3.Add(1);
        Nums3.Add(2);
        Nums3.Add(1);


        sound.Add(cS.audioSource);
        sound.Add(cS1.audioSource);
        sound.Add(cS2.audioSource);
        sound.Add(cS3.audioSource);

        InGameText.SetText("");

        //ChangeCol();
    }
示例#28
0
    void Update()
    {
        if (Input.GetKey(KeyCode.K))
        {
            StageSpotlight.FollowTransform(players[0].transform);
        }

        GamemodeDefinition.WinResult winResult = gameMode.VerifyWin(this, Time.deltaTime);
        if (winResult.finished)
        {
            gameMode.OnGameEnd(this);
            winUI.gameObject.SetActive(true);
            if (winResult.winners.Count > 1)
            {
                winUI.SetText("EVERYONE'S A WINNER!");
            }
            else
            {
                winUI.SetText(players[winResult.winners[0]].tankDisplayName + " Wins!");
            }
            StartCoroutine(GoBackToMainMenu());
        }

        if (Input.GetKey(KeyCode.Space))
        {
            winUI.gameObject.SetActive(true);
            if (winResult.winners.Count > 1)
            {
                winUI.SetText("EVERYONE'S A WINNER!");
            }
            else
            {
                winUI.SetText(players[winResult.winners[0]].tankDisplayName + " Wins!");
            }
            StartCoroutine(GoBackToMainMenu());
        }

        Vector4[] playerPositions = new Vector4[4];
        for (int i = 0; i < 4; i++)
        {
            if (IsPlayerValid(i))
            {
                playerPositions[i] = new Vector4(players[i].transform.position.x, players[i].transform.position.y, players[i].transform.position.z, 1);
            }
            else
            {
                playerPositions[i] = Vector4.zero;
            }
        }
        Shader.SetGlobalVectorArray("_PlayerPositions", playerPositions);
    }
示例#29
0
 // Update is called once per frame
 void Update()
 {
     if (timer >= 1.0f)
     {
         timer -= Time.deltaTime;
         text.SetText(Mathf.FloorToInt(timer).ToString());
     }
     else
     {
         text.SetText(Mathf.FloorToInt(timer).ToString());
         // Call end of game
         CallbackHandler.instance.EndGame();
     }
 }
示例#30
0
    /// <summary>
    ///  INUTILE
    /// </summary>
    public void SetText()
    {
        text.SetText("");

        foreach (Carte carte in partie.TrouverJoueur(J2).main)
        {
            text.text += carte.titre + "\n";
        }

        if (text.text.Length == 0)
        {
            text.SetText("Main vide !");
        }
    }