Inheritance: MonoBehaviour
示例#1
0
    IEnumerator gameOver(string defeatReason)
    {
        AudioManager.amInstance.playDefeatTune();

        battleEnded = true;

        showInfoTextPanel();
        if (defeatReason == "NoCardsLeft")
        {
            changeInfoText(TextScript.get(TextScript.Sentence.LOSE_NO_CARDS));
        }
        else if (defeatReason == "NoHealth")
        {
            changeInfoText(TextScript.get(TextScript.Sentence.LOSE));
        }
        else if (defeatReason == "GiveUp")
        {
            changeInfoText(TextScript.get(TextScript.Sentence.SURRENDER));
        }

        if (skipEnemyDialogue)
        {
            prepareWaitForInfoTextPanel(2f);
        }
        else
        {
            prepareWaitForInfoTextPanel(5f);
        }
        yield return(new WaitWhile(() => showingInfoTextPanel)); // Wait for info text box

        showWinLosePanel(new Color(1f, 0.6f, 0.6f), new Color(0.6f, 0.1f, 0.1f), Result.DEFEAT);
    }
示例#2
0
    void updateName()
    {
        switch (id)
        {
        case FortuneId.ENDURANCE:
            name = TextScript.get(TextScript.Sentence.F0_NAME);
            break;

        case FortuneId.QUICK_START:
            name = TextScript.get(TextScript.Sentence.F1_NAME);
            break;

        case FortuneId.SHIELD:
            name = TextScript.get(TextScript.Sentence.F2_NAME);
            break;

        case FortuneId.REGEN:
            name = TextScript.get(TextScript.Sentence.F3_NAME);
            break;

        case FortuneId.LOWER_CEIL:
            name = TextScript.get(TextScript.Sentence.F4_NAME);
            break;

        case FortuneId.EXTRA_EXP:
            name = TextScript.get(TextScript.Sentence.F5_NAME);
            break;

        case FortuneId.EXTRA_PRIZE_CARD:
            name = TextScript.get(TextScript.Sentence.F6_NAME);
            break;
        }
    }
示例#3
0
 // Start is called before the first frame update
 void Start()
 {
     gameController       = GameObject.Find("GameController");
     gameControllerObject = gameController.GetComponent <GameControllerScript>();
     textObject           = GameObject.Find("Canvas").transform.GetChild(1).gameObject;
     textObjectScript     = textObject.GetComponent <TextScript>();
 }
示例#4
0
    public void LethalThreat(CharacterBattle targetCharacterBattle, Action onAttackComplete)
    {
        Vector3 slideTargetPosition = (targetCharacterBattle.GetPosition() + (GetPosition() - targetCharacterBattle.GetPosition()).normalized * 10f) + new Vector3(30, 0);
        Vector3 startingPosition    = GetPosition();

        string LoginScreen = CharStats.name + " uses Lethal Threat on " + targetCharacterBattle.CharStats.name;

        TextScript.Create(new Vector3(-50, -40), LoginScreen, 45, true);


        foreach (ParticleSystem ps in particles)
        {
            if (ps.name == "Dash")
            {
                toDestroy = Instantiate(ps, this.transform).gameObject;
            }
        }
        // Slide to Target
        going = true;
        SlideToPosition(slideTargetPosition, () => {
            // Arrived at Target, attack him
            state = State.Busy;
            targetCharacterBattle.Damage(this, CharStats.Damage);
            SlideToPosition(startingPosition, () =>
            {
                // Slide back completed, back to idle
                state = State.Idle;
                onAttackComplete();
            });
        }, "JabMelee2H");
    }
示例#5
0
    void updateMainBattleButton()
    {
        Text battleButtonText = battleButton.GetComponentInChildren <Text>();

        battleButtonText.text = TextScript.get(TextScript.Sentence.RANK) + " " + (currentDifficultyId + 1) + "\n\n";
        int mod = currentDifficultyId % 5; // Cycling value between 0~4

        switch (mod)
        {
        case 0:
            battleButtonText.text += TextScript.get(TextScript.Sentence.ATTACK_ROLLS) + ": 1~5";
            break;

        case 1:
            battleButtonText.text += TextScript.get(TextScript.Sentence.ATTACK_ROLLS) + ": 1~4";
            break;

        case 2:
            battleButtonText.text += TextScript.get(TextScript.Sentence.ATTACK_ROLLS) + ": 1~3";
            break;

        case 3:
            battleButtonText.text += TextScript.get(TextScript.Sentence.ATTACK_ROLLS) + ": 1~2";
            break;

        case 4:
            battleButtonText.text += TextScript.get(TextScript.Sentence.ATTACK_ROLL) + ": 1";
            break;
        }
    }
示例#6
0
    public void Smoke(List <CharacterBattle> targets, Action onAttackComplete)
    {
        animator.Play("Victory");
        GameObject BindParticle = null;

        state = State.Busy;
        foreach (ParticleSystem ps in particles)
        {
            if (ps.name == "Smoke")
            {
                toDestroy = Instantiate(ps).gameObject;
            }
            if (ps.name == "Blind")
            {
                BindParticle = ps.gameObject;
            }
        }

        string LoginScreen = CharStats.name + " uses Smoke on Enemies";

        TextScript.Create(new Vector3(-50, -40), LoginScreen, 45, true);

        waitPosition(() => {
            foreach (CharacterBattle tg in targets)
            {
                tg.blinded         = true;
                tg.DeBuffTurns     = 5;
                tg.deBuffToDestroy = Instantiate(BindParticle, tg.transform);
            }

            onAttackComplete();
            state = State.Idle;
        });
    }
示例#7
0
    static string getPlayerWeakTurnDialogue()
    {
        List <string> texts = new List <string>
        {
            T.get(S.D24),
            T.get(S.D25),
            T.get(S.D26),
            T.get(S.D27),
            T.get(S.D28),
            T.get(S.D29),
            T.get(S.D30),
            T.get(S.D31),
            T.get(S.D32),
            T.get(S.D33),
            T.get(S.D34),
            T.get(S.D35),
            T.get(S.D36),
            T.get(S.D37),
            T.get(S.D38)
        };

        if (Player.health == 1)
        {
            for (int i = 0; i < 3; i++)
            {
                texts.AddRange(new List <string> {
                    T.get(S.D39),
                    T.get(S.D40),
                    T.get(S.D41)
                });
            }
        }
        return(getRandomChoiceFrom(texts));
    }
示例#8
0
    private void Start()
    {
        parentTransform    = transform.GetChild(0);
        listaToggles       = new List <TextScript>();
        nombreEstadisticas = GetComponent <EstadisticaDeporte>();
        Array listaTipoEstadisticas = nombreEstadisticas.GetEstadisticas();

        for (int i = 0; i < listaTipoEstadisticas.Length; i++)
        {
            if ((EstadisticaDeporte.Estadisticas)listaTipoEstadisticas.GetValue(i) >= 0)
            {
                //SE DEBERÍA OBTENER DE nombreEstadisticas, EL TIPO DEL ENUM Y TRABAJR CON ESO EN VEZ DE CON EL NOMBRE
                GameObject toggleGO = Instantiate(togglePrefab, parentTransform, false);

                string[] nameEspañol = EstadisticasDeporteDisplay.GetStatisticsName((EstadisticaDeporte.Estadisticas)listaTipoEstadisticas.GetValue(i), AppController.Idiomas.Español); // nombreEstadisticas.GetStatisticsName(i, AppController.Idiomas.Español);
                string[] nameIngles  = EstadisticasDeporteDisplay.GetStatisticsName((EstadisticaDeporte.Estadisticas)listaTipoEstadisticas.GetValue(i), AppController.Idiomas.Ingles);  //nombreEstadisticas.GetStatisticsName(i, AppController.Idiomas.Ingles);

                TextScript txtScript = toggleGO.GetComponent <TextScript>();
                txtScript.SetTipoEstadistica((EstadisticaDeporte.Estadisticas)listaTipoEstadisticas.GetValue(i));
                txtScript.SetName(nameEspañol[0], nameEspañol[1], AppController.Idiomas.Español);
                toggleGO.GetComponent <TextScript>().SetName(nameIngles[0], nameIngles[1], AppController.Idiomas.Ingles);
                listaToggles.Add(toggleGO.GetComponent <TextScript>());
            }
        }

        /*
         * for (int i = 0; i < listaEstadisticas.Count; i++)
         * {
         *  GameObject toggleGO = Instantiate(togglePrefab, parentTransform, false);
         *  toggleGO.GetComponent<TextScript>().SetName(listaEstadisticas[i], listaIniciales[i]);
         *  listaToggles.Add(toggleGO.GetComponent<Toggle>());
         * }*/

        prefabHeight = togglePrefab.GetComponent <RectTransform>().rect.height;
    }
示例#9
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray = cam.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit))
            {
                if (hit.transform == transform)
                {
                    clicks++;
                    // draw + 1
                    TextScript textScript = Instantiate(plusOne);
                    textScript.transform.position = cam.ScreenToWorldPoint(Input.mousePosition);
                    textScript.text    = "+1";
                    textScript.fadeOut = true; // make it fade away
                    // make button appear to be clicked
                    StartCoroutine(resize());
                    // play click sound
                    source.PlayOneShot(click);
                }
            }
        }

        if (clicks >= 1000)
        {
            points.text = UTIL.formatNumber(Mathf.Floor(clicks), 2, true);
        }
        else
        {
            points.text = "" + Mathf.Floor(clicks);
        }
    }
示例#10
0
    string getExplanationText()
    {
        double newRerollPoints = getRerollPoints(HubControl.maxUnlockedDifficultyId);

        string explanationText = TextScript.get(TextScript.Sentence.REROLL_EXPLANATION_INTRO) +

                                 "<b>" + TextScript.get(TextScript.Sentence.REROLL_CARDS) + " +"
                                 + NumberStringConverter.convert(newRerollPoints + Player.rerollPoints)
                                 + "</b> (" + TextScript.get(TextScript.Sentence.CURRENT) + ": +" +
                                 NumberStringConverter.convert(Player.rerollPoints) + ")\n" +

                                 "<b>" + TextScript.get(TextScript.Sentence.REROLL_EXP) + " x"
                                 + NumberStringConverter.convert(getRerollExpMult(newRerollPoints + Player.rerollPoints))
                                 + "</b> (" + TextScript.get(TextScript.Sentence.CURRENT) + ": x" +
                                 NumberStringConverter.convert(getRerollExpMult(Player.rerollPoints)) + ")\n" +

                                 "<b>" + TextScript.get(TextScript.Sentence.REROLL_SKIP) + " "
                                 + NumberStringConverter.convert(getRerollSkip(newRerollPoints + Player.rerollPoints))
                                 + "</b> (" + TextScript.get(TextScript.Sentence.CURRENT) + ": " +
                                 NumberStringConverter.convert(getRerollSkip(Player.rerollPoints)) + ")\n\n" +

                                 ((Player.isAndroid()) ? TextScript.get(TextScript.Sentence.REROLL_EXPLANATION_END_TAP) :
                                  TextScript.get(TextScript.Sentence.REROLL_EXPLANATION_END_CLICK));

        return(explanationText);
    }
示例#11
0
	//public static HelpPipeCon Instance;

//	private static HelpPipeCon _instance;
//	
//	/// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//	/// 
//	// Static singleton property
//	public static HelpPipeCon Instance
//	{
//		// Here we use the ?? operator, to return 'instance' if 'instance' does not equal null
//		// otherwise we assign instance to a new component and return that
//		get 
//		{ 
//			if(_instance == null)
//			{
//				GameObject obj = new GameObject ();
//				obj.hideFlags = HideFlags.HideAndDontSave;
//				_instance = obj.AddComponent<HelpPipeCon> ();
//			}
//			
//			return _instance;
//		}
//	}


	/// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Use this for initialization
	void Awake () {

		Instance = this;

		helpPopupCon = GameObject.Find("Popup_Help").GetComponent<HelpPopupCon>();

		ts = TextScript.Instance;

		helpState = 0;

		efm = EffectSoundManagerScript.Instance;

		go_HState = new GameObject[12];
		for(int i=0; i<12; i++)
		{
			go_HState[i] = GameObject.Find("HStage"+i);
		}
//		Debug.Log("1");
//		gd = GlobalData.Instance;
//		gameCon = GameCon.Instance;//GameObject.Find ("GameCon").GetComponent<GameCon>();

		go_popup = GameObject.Find("Popup_Help");

		gd = GlobalData.Instance;
		gd.setTileNum(0, true);


//		help_PipeIndex  = 173;
//		setHelpPipe(help_PipeIndex);
//
//
////		TweenPosition twPosition = TweenPosition.Begin(go_popup, 0.3f, new Vector3(0, 0, 0));
////		twPosition.method = UITweener.Method.BounceIn;
	}
示例#12
0
    public IEnumerator win()
    {
        if (!isTutorial)
        {
            Player.stats[Player.Stat.VICTORIES]++;
        }
        AudioManager.amInstance.playVictoryTune();

        battleEnded = true;
        showHUD();
        showInfoTextPanel();

        changeInfoText(TextScript.get(TextScript.Sentence.WIN));
        if (skipEnemyDialogue)
        {
            prepareWaitForInfoTextPanel(2f);
        }
        else
        {
            prepareWaitForInfoTextPanel(5f);
        }
        yield return(new WaitWhile(() => showingInfoTextPanel)); // Wait for info text box

        showWinLosePanel(new Color(0.6f, 1f, 0.6f), new Color(0.2f, 0.75f, 0.2f), Result.VICTORY);
    }
示例#13
0
文件: Enemy.cs 项目: svm92/RNG-Game
    public double receiveDamage(double damage)
    {
        damage = applyShieldDamageReduction(damage);
        if (damage < 0)
        {
            damage = 0;
        }

        health -= damage;
        if (health < 0)
        {
            health = 0;
        }

        if (!BattleManager.isTutorial)
        {
            Player.stats[Player.Stat.TOTAL_DAMAGE_DEALT] += damage;
        }

        refreshHealthHUD(false);

        BattleManager.bmInstance.showInfoTextPanel();
        string attackDescription = TextScript.get(TextScript.Sentence.CAUSE_DAMAGE_A) + " " +
                                   NumberStringConverter.convert(damage) + " " + TextScript.get(TextScript.Sentence.CAUSE_DAMAGE_B);

        BattleManager.bmInstance.changeInfoText(attackDescription);

        return(damage);
    }
示例#14
0
    public static string getArmDescription(Arm arm, ArmAspect armAspect)
    {
        string armAspectLetter = "";

        switch (armAspect)
        {
        case ArmAspect.NORMAL:
        default:
            armAspectLetter = "";
            break;

        case ArmAspect.SILVER:
            armAspectLetter = "_S";
            break;

        case ArmAspect.GOLD:
            armAspectLetter = "_G";
            break;
        }

        TextScript.Sentence armName = (TextScript.Sentence)
                                      System.Enum.Parse(typeof(TextScript.Sentence), "ARM" + (int)arm, true);

        TextScript.Sentence armDescription = (TextScript.Sentence)
                                             System.Enum.Parse(typeof(TextScript.Sentence), "ARM" + (int)arm + "_DESC" + armAspectLetter, true);

        return("<b>" + TextScript.get(armName) + "</b>\n\n" + TextScript.get(armDescription));
    }
示例#15
0
    public static string getCoreDescription(Core core)
    {
        Sentence coreSentence     = (Sentence)System.Enum.Parse(typeof(Sentence), "CORE" + (int)core, true);
        Sentence coreDescSentence = (Sentence)System.Enum.Parse(typeof(Sentence), "CORE" + (int)core + "_DESC", true);

        return("<b>" + TextScript.get(coreSentence) + "</b>\n" + TextScript.get(coreDescSentence));
    }
示例#16
0
 public void setDialog(TextScript ts)
 {
     textScript = ts;
     endDialog  = false;
     maxPhrase  = textScript.getMax();
     condition  = -1;
 }
示例#17
0
    public IEnumerator playCardAsync()
    {
        if (!BattleManager.playerActionAllowed || BattleManager.battleEnded)
        {
            yield break;
        }
        if (BattleManager.isTutorial && Player.currentTurn == 4 && card.cardEffect.condition == CardEffect.Condition.INSTANT)
        {
            StartCoroutine(TutorialManager.forceEnemyDialogue(TextScript.get(TextScript.Sentence.T24), 4f));
            yield break;
        }

        BattleManager.bmInstance.hideSurrenderButton();

        yield return(waitForCardAnimation());

        Hand.removeCard(gameObject);
        BattleManager.bmInstance.hideHand();
        activateEffect();
        if (!BattleManager.isTutorial)
        {
            BattleManager.bmInstance.initiateBattleLogicFlow(card.cardEffect);
        }
        else
        {
            TutorialManager.playedCardInTutorial          = true;
            BattleManager.bmInstance.showingInfoTextPanel = false;
        }
    }
 // Use this for initialization
 void Start()
 {
     textScript = GetComponent<TextScript>();
     textComponent = GetComponent<Text>();
     previousText = textScript.text;
     previousState = textComponent.enabled;
     timer = scrollDelay;
 }
示例#19
0
        /// <inheritdoc/>
        public override void SetUnicodeProperties(TextDirection direction, TextScript script, String language)
        {
            Contract.EnsureNotDisposed(this, Disposed);

            this.direction = direction;
            this.script    = script;
            this.language  = language;
        }
示例#20
0
        /// <inheritdoc/>
        public override void GetUnicodeProperties(out TextDirection direction, out TextScript script, out String language)
        {
            Contract.EnsureNotDisposed(this, Disposed);

            direction = this.direction;
            script    = this.script;
            language  = this.language;
        }
示例#21
0
    public void Setup(bool isPlayerTeam, GameObject Own)
    {
        this.isPlayerTeam = isPlayerTeam;

        m_GameObject    = Instantiate(Own, transform.position, Quaternion.identity, transform);
        ObjectiveCursor = m_GameObject.transform.Find("Objective").gameObject;
        ObjectiveCursor.SetActive(false);
        CharStats = m_GameObject.GetComponent <Stats>();
        Level     = CharStats.Level;
        Health    = CharStats.Health;
        Speed     = CharStats.Speed;
        charclass = CharStats.charclass;
        particles = CharStats.particles;
        LM        = m_GameObject.GetComponent <LayerManager>();

        CharStats.parent = this.gameObject;

        if (isPlayerTeam)
        {
            InShield = m_GameObject.transform.Find("SheerWillShield").gameObject;
        }
        else
        {
            Vector3 transform = m_GameObject.transform.localScale;
            transform.x *= -1;
            m_GameObject.transform.localScale = transform;
        }

        Vector3 namePos = transform.position;

        invulnerable = false;
        healthSystem = new HealthSystem(CharStats.Health);
        if (CharStats.name != "Amadea")
        {
            healthBar = new World_Bar(transform, new Vector3(0, 24), new Vector3(12, 1.7f), Color.grey, Color.red, 1f, 100, new World_Bar.Outline {
                color = Color.black, size = .6f
            });
            namePos.x -= 8;
            namePos.y += 25;
        }
        else
        {
            healthBar = new World_Bar(transform, new Vector3(0, 29), new Vector3(12, 1.7f), Color.grey, Color.red, 1f, 100, new World_Bar.Outline {
                color = Color.black, size = .6f
            });
            namePos.x -= 8;
            namePos.y += 30;
        }

        healthSystem.OnHealthChanged += HealthSystem_OnHealthChanged;
        animator = m_GameObject.GetComponentInChildren <Animator>();
        going    = false;

        TextScript.Create(namePos, CharStats.name, 35, false, gameObject);


        //PlayAnimIdle();
    }
示例#22
0
    // Use this for initialization
    void Start()
    {
        chapnumber = 0;

        TextScript tex = this.gameObject.GetComponent <TextScript>();

        cheak          = PlayerPrefs.GetInt(CHAP_NUM_KEY, -1);
        storyText.text = tex.chapter1[chapnumber];
    }
示例#23
0
    Text[] diceEndModifierTexts; // 0~9

    private void Awake()
    {
        handCanvas         = GameObject.FindGameObjectWithTag("HandCanvas").transform;
        hud                = GameObject.FindGameObjectWithTag("HUD").transform;
        infoTextPanel      = hud.Find("InfoTextPanel").gameObject;
        helpTextPanel      = hud.Find("HelpTextPanel").gameObject;
        dialoguePanel      = GameObject.Find("DialoguePanel");
        healthText         = hud.Find("HealthText").GetComponent <Text>();
        diceText           = hud.Find("DiceText").GetComponent <Text>();
        deckText           = hud.Find("DeckText").GetComponent <Text>();
        infoText           = infoTextPanel.transform.Find("InfoText").GetComponent <Text>();
        helpText           = helpTextPanel.transform.Find("HelpText").GetComponent <Text>();
        dialogueText       = dialoguePanel.transform.Find("DialogueText").GetComponent <Text>();
        healthIcon         = hud.Find("HealthIcon").GetComponent <RectTransform>();
        diceIcon           = hud.Find("DiceIcon").GetComponent <RectTransform>();
        deckIcon           = hud.Find("DeckIcon").GetComponent <RectTransform>();
        enemyInfoPanel     = GameObject.FindGameObjectWithTag("EnemyInfoCanvas").transform.GetChild(0).gameObject;
        victoryPanel       = GameObject.FindGameObjectWithTag("VictoryCanvas").transform.GetChild(0).gameObject;
        flashImageAnimator = GameObject.FindGameObjectWithTag("FlashImage").GetComponent <Image>().GetComponent <Animator>();
        if (isTutorial)
        {
            tutorialGizmos = GameObject.Find("TutorialGizmos").transform;
        }
        surrenderButton = GameObject.Find("GiveUpButton");
        hideInfoTextPanel();

        busy = true;
        playerActionAllowed = false;
        battleEnded         = false;
        damageDealtToEnemy  = 0;

        skipDrawingEveryThirdTurn = false;

        enemyInteractable    = false;
        showingInfoTextPanel = false;
        diceEndModifierTexts = new Text[10]; // 0~9
        Player.currentTurn   = 0;
        battleDeck           = Player.deck.clone();

        Transform diceEndRollTr = GameObject.FindGameObjectWithTag("DiceEndRoll").transform;

        for (int i = 0; i < diceEndModifierTexts.Length; i++)
        {
            diceEndModifierTexts[i] = diceEndRollTr.GetChild(i).GetComponent <Text>();
        }

        if (isTutorial)
        {
            Destroy(surrenderButton);
        }
        else
        {
            surrenderButton.GetComponentInChildren <Text>().text = TextScript.get(TextScript.Sentence.GIVE_UP);
        }

        bmInstance = this;
    }
示例#24
0
 public void checkIfReroll()
 {
     nTimesPressedReroll++;
     rerollButton.GetComponentInChildren <Text>().text = TextScript.get(TextScript.Sentence.REROLL)
                                                         + "(" + nTimesPressedReroll + ")";
     if (nTimesPressedReroll >= 5)
     {
         reroll();
     }
 }
示例#25
0
    private void Awake()
    {
        returnButton = GameObject.Find("ReturnButton").GetComponent <Button>();
        rerollButton = GameObject.Find("RerollButton").GetComponent <Button>();

        returnButton.GetComponentInChildren <Text>().text             = TextScript.get(TextScript.Sentence.RETURN);
        rerollButton.GetComponentInChildren <Text>().text             = TextScript.get(TextScript.Sentence.REROLL);
        GameObject.Find("Label").GetComponent <Text>().text           = TextScript.get(TextScript.Sentence.REROLL_UPPERCASE);
        GameObject.Find("ExplanationText").GetComponent <Text>().text = getExplanationText();
    }
示例#26
0
    // Use this for initialization
    void Start()
    {
        GameObject mainCharacter = GameObject.FindGameObjectWithTag("MainCharacterShop");

        mainCharacterScript = (MainCharacterScript)mainCharacter.GetComponent(typeof(MainCharacterScript));

        GameObject textHolder = GameObject.FindGameObjectWithTag("TextHolderShop");

        textScript = (TextScript)textHolder.GetComponent(typeof(TextScript));
    }
示例#27
0
 // Use this for initialization
 void Start()
 {
     moving            = true;
     goblinsKilledText = goblinsKilled.GetComponent <TextScript>();
     goblinsGoldText   = goblinsGold.GetComponent <TextScript>();
     leadersKilledText = leadersKilled.GetComponent <TextScript>();
     leadersGoldText   = leadersGold.GetComponent <TextScript>();
     totalText         = total.GetComponent <TextScript>();
     scoreScreen       = GameObject.FindGameObjectWithTag("ScoreScreen");
 }
示例#28
0
    // Update is called once per frame
    void Update()
    {
        TextScript tex = this.gameObject.GetComponent <TextScript>();



        if (Input.GetMouseButtonDown(0))
        {
            switch (cheak)
            {
            case 10:
                storyText.text = tex.chapter10[chapnumber];
                break;

            case 9:
                storyText.text = tex.chapter9[chapnumber];
                break;

            case 8:
                storyText.text = tex.chapter8[chapnumber];
                break;

            case 7:
                storyText.text = tex.chapter7[chapnumber];
                break;

            case 6:

                storyText.text = tex.chapter6[chapnumber];
                break;

            case 5:
                storyText.text = tex.chapter5[chapnumber];
                break;

            case 4:
                storyText.text = tex.chapter4[chapnumber];
                break;

            case 3:
                storyText.text = tex.chapter3[chapnumber];
                break;

            case 2:
                storyText.text = tex.chapter2[chapnumber];
                break;

            case 1:
                storyText.text = tex.chapter1[chapnumber];
                break;
            }

            chapnumber++;
        }
    }
示例#29
0
    static string getLoseNoCardsDialogue()
    {
        List <string> texts = new List <string>
        {
            T.get(S.D288),
            T.get(S.D289),
            T.get(S.D290)
        };

        return(getRandomChoiceFrom(texts));
    }
示例#30
0
 // Start is called before the first frame update
 void Start()
 {
     gameController       = GameObject.Find("GameController");
     gameControllerObject = gameController.GetComponent <GameControllerScript>();
     spriteObject         = GetComponent <SpriteRenderer>();
     currentScene         = SceneManager.GetActiveScene().name;
     playerObject         = GameObject.Find("Player");
     textObject           = playerObject.GetComponent <PlayerController>().textBox;
     textObjectScript     = playerObject.GetComponent <PlayerController>().textObjectScript;
     transformParticles   = GameObject.Find("TransformParticles").GetComponent <ParticleSystem>();
 }
示例#31
0
 private void ActiveSpeech(TextScript script)
 {
     if (script.Type == TextScript.ScriptType.Top)
     {
         topSpeech.Active(script.Character.CharacterName, script.Text);
     }
     else
     {
         bottomSpeech.Active(script.Character.CharacterName, script.Text);
     }
 }
示例#32
0
    void updateExpText()
    {
        double totalSellValue = getTotalSellValueToShow();

        expText.text = NumberStringConverter.convert(Player.experience) + " " + TextScript.get(TextScript.Sentence.EXP);
        if (totalSellValue > 0)
        {
            expText.text += "\n<color=#559911>(+" +
                            NumberStringConverter.convert(totalSellValue) + " " + TextScript.get(TextScript.Sentence.EXP) + ")</color>";
        }
    }
 /// <summary>
 /// Inicialización de los componentes de Text y la imagen que se superpone al ser golpeado
 /// </summary>
 void Start()
 {
     text = GameObject.Find ("Text").GetComponent<TextScript> ();
     image = GameObject.Find ("Image").GetComponent<ImageScript> ();
 }
示例#34
0
    // Use this for initialization
    void Start()
    {
        transitionDone = true;
        totalLevels = Constants.lastPlayableSceneIndex - Constants.introSceneIndex;
        recordManager = gameObject.GetComponent("RecordManager") as RecordManager;
        currentLevel = 1;
        last = currentLevel;
        display = last;

        if (spacing == 0)
            spacing = 0.5f;

        backButtonTextScript = backButton.GetComponent("TextScript") as TextScript;
        nextButtonTextScript = nextButton.GetComponent("TextScript") as TextScript;

        instantiateTexts();
        initTextScripts();
        initTransitionValues();
        initIsDoneTransition();
    }
示例#35
0
    // Use this for initialization
    void Start()
    {
        if (!PlayerPrefs.HasKey(Constants.LevelToLoadKey))
        {
            PlayerPrefs.SetInt(Constants.LevelToLoadKey,0);
            sceneToLoad = 0;
        }
        else
        {
            sceneToLoad = PlayerPrefs.GetInt(Constants.LevelToLoadKey);
        }

        // default to normal mode
        PlayerPrefs.SetString (Constants.GameModeKey,Constants.GameModeNormal);

        display = (int)MenuState.MainMenuOptions;
        last = display;
        transitionDone = true;

        MainMenuOptionScripts = new List<TextScript>();
        ContinueMenuOptionScripts = new List<TextScript>();
        ModeMenuOptionScripts = new List<TextScript>();

        MainMenuNames = new List<string>();
        ContinueMenuNames = new List<string>();
        ModeMenuNames = new List<string>();

        // retrieve classes associated with each text
        for (int i = 0 ; i < MainMenuOptions.Length ; i++)
        {
            MainMenuOptionScripts.Add(MainMenuOptions[i].GetComponent<TextScript>());
        }

        for (int i = 0 ; i < ContinueMenuOptions.Length ; i++)
        {
            TextScript ts = ContinueMenuOptions[i].GetComponent<TextScript>(); // TODO: Only add levels that we should have access to

            if(ts.textName.Equals(Constants.continueBackButton))
                ContinueMenuOptionScripts.Add(ts);
            else if (ts.textName.Equals(Constants.loadRecordLevel))
                ContinueMenuOptionScripts.Add(ts);
            else if (ts.textName.Equals(Constants.loadCharProfiles))
                ContinueMenuOptionScripts.Add(ts);
            else if (int.Parse(ts.textName) <= sceneToLoad)
                ContinueMenuOptionScripts.Add(ts);
        }

        for (int i = 0 ; i < ModeMenuOptions.Length ; i++)
        {
            TextScript ts = ModeMenuOptions[i].GetComponent<TextScript>();
            ModeMenuOptionScripts.Add (ts);

            if (ts.textName.Equals("Normal"))
                ntScript = ts;
            else if (ts.textName.Equals ("SpeedRun"))
                srtScript = ts;
        }

        ntScript.selectText();
        srtScript.unselectText();

        initTransitionValues();
        initIsDoneTransition();
    }
示例#36
0
	// Use this for initialization
	void Awake () {

		InventoryItemButtonObj = GameObject.Find("InventoryButton");
		InventoryItemButtonObj.SetActive(false);
		ConveyorItemButtonObj = GameObject.Find("conveyorButton");

		Pan_inventoryScrollView = GameObject.Find ("Panel_inventoryScrollView");

		go_FillRect_Screen = GameObject.Find("FillRect_Screen");
		go_FillRect_Screen.SetActive(false);

		float resolWidth = Screen.width;
//		Debug.Log("resolWidth:  "+resolWidth);
		float resolHeight = Screen.height;
//		Debug.Log("resolHeight:  "+resolHeight);

		float ratio1 = resolWidth/resolHeight;
//		Debug.Log("ratio1:  "+ratio1);
		float gameWidth = 800 * ratio1;
//		Debug.Log("gameWidth:  "+gameWidth);


		float ratio = gameWidth/1280;


		float tmpWidth = (gameWidth - 372*ratio);

		Vector4 range = new Vector4(0, 0, tmpWidth, 160);
		//Pan_inventoryScrollView.GetComponent<UIPanel>().clipping = UIDrawCall.Clipping.SoftClip;
		Pan_inventoryScrollView.GetComponent<UIPanel>().baseClipRegion = range;
		//Pan_inventoryScrollView.GetComponent<UIPanel>().drawCallClipRange = new Vector4(0, 0, Screen.width - 360, 160);

		gd = GlobalData.Instance;
		//		GameObject.Find("Prefab_Pipe").GetComponent<PipeScript>().setID(170);
		//		GameObject.Find("Prefab_Pipe1").GetComponent<PipeScript>().setID(171);
		//		GameObject.Find("Prefab_Pipe2").GetComponent<PipeScript>().setID(172);
		//		GameObject.Find("Prefab_Pipe3").GetComponent<PipeScript>().setID(173);
		//		GameObject.Find("Prefab_Pipe4").GetComponent<PipeScript>().setID(64);
		//		GameObject.Find("Prefab_Pipe5").GetComponent<PipeScript>().setID(65);
		//
		Instance = this;
		
		efm = EffectSoundManagerScript.Instance;

		pd = PlayerData.Instance;

		gd.setTileNum(0, true);

		go_Popup_Help = GameObject.Find("Popup_Help");
		helpPopupCon = GameObject.Find("Popup_Help").GetComponent<HelpPopupCon>();

		ts = TextScript.Instance;


		uiSlider_Loading = GameObject.Find ("loading_Slider").GetComponent<UISlider> ();
		uiSlider_Loading.value = 0;
		
		bJustOneTimeCoroutine = false;
		go_fade = GameObject.Find("Anchor_Center_Fade");
		
		bLoading = true;
		loading_state = 0;


		
	}
	// Use this for initialization
	void Awake () 
	{

		efm = EffectSoundManagerScript.Instance;

		ts = TextScript.Instance;

		scrollBar = GameObject.Find ("ScrollBar");

		helpPopupCon = GameObject.Find("Popup_Help").GetComponent<HelpPopupCon>();
		//hpc.InitPopup();

		go_Popup_Help = GameObject.Find("Popup_Help");


		GameCon.bgNum = Random.Range (0, 7);
		GameCon.setBgAtlasSet (GameCon.bgNum);
		setBg ();
		
		// buy pop-up
		Popup_Panel_Buy_Obj = GameObject.Find ("Popup_Panel_Buy");
		Popup_Panel_Buy_Obj.SetActive (false);
		
		

		//info popup Initialize.....................................................................
		Popup_Panel_Obj = GameObject.Find ("Popup_Info");
		Popup_Panel_Obj.SetActive (false);

		Popup_Panel_OK_Obj = GameObject.Find ("Popup_Info_OK");
		Popup_Panel_OK_Obj.SetActive (false);
		popupState = 0;	//no popup
		//end info popup Initialize.....................................................................

		pd = PlayerData.Instance;

		btnIndex = 0;

		//tempBuyCount = new int[PlayerData.PIPE_ITEM_MAX] ;
		item = new GameObject[PlayerData.PIPE_ITEM_MAX];
		posCount = new GameObject[PlayerData.PIPE_ITEM_MAX];
		posMaxCount = new GameObject[PlayerData.PIPE_ITEM_MAX];
		costLabel = new GameObject[PlayerData.PIPE_ITEM_MAX];
		cursorObj = new GameObject[PlayerData.PIPE_ITEM_MAX];
		
		itemContainer = new GameObject[PlayerData.PIPE_ITEM_MAX];

		gd = GlobalData.Instance;
		gd.setTileNum(0, true);
		GameCon.setAtlasSet (GlobalData.baseTileNum);
		uia = Resources.Load<UIAtlas> (GameCon.basePipeAtlasPath);

		Vector3 v3pos;
		for (int i=0; i<PlayerData.PIPE_ITEM_MAX; i++) 
		{
			item [i] = GameObject.Find ("Item" + i);

			v3pos = item[i].transform.localPosition;
			v3pos.x = 30 + 390*i;
			item[i].transform.localPosition = v3pos;

			if(i < pd.invenOpenLevel)
			{
				setItemValue(i);
			}
			else
			{
				item [i].SetActive(false);
			}
		}

//		Debug.Log ("pd.invenOpenLevel:"+pd.invenOpenLevel);
//		for (int i=0; i<pd.invenOpenLevel; i++) {
//			setItemValue(i);
//		}

		totalCostLabel = GameObject.Find ("totalCostLabel");
		goldLabel = GameObject.Find ("goldLabel");
	}
 // Use this for initialization
 void Start()
 {
     textScript = dialogueToTrigger.GetComponent<TextScript>();
 }