Inheritance: MonoBehaviour
    private void Update()
    {
        if (heroStandingOnThisTile && Input.GetButtonDown("AButton"))
        {
            if (currentlyStandingOnInteractableTile)
            {
                if (!hasBeenOpened)
                {
                    GameManager.gm.leader.DisableMovement();
                    TextBoxManager textManager = TextBoxManager.tbm;
                    textManager.currentLine = 0;
                    textManager.endLine     = 0; // Controls how many windows

                    string boxMessage = "Inside the chest, you found "
                                        + goldInside + " Gold!";
                    TextBoxManager.tbm.EnableTextBox(
                        null, boxMessage, true, false, true);

                    Inventory.GainGold(goldInside);

                    hasBeenOpened          = true;
                    heroStandingOnThisTile = false;
                }
                else
                {
                }
            }
            else
            {
                heroStandingOnThisTile = false;
            }
        }
    }
Example #2
0
 // Use this for initialization
 protected virtual void Start()
 {
     playerObj   = GameObject.FindGameObjectWithTag("Player");
     player      = playerObj.GetComponent <PlayerController> ();
     gameMaster  = FindObjectOfType <GameController> ();
     textManager = FindObjectOfType <TextBoxManager> ();                     // gets the script
 }
Example #3
0
        // Token: 0x06000060 RID: 96 RVA: 0x000054A4 File Offset: 0x000036A4
        public void Interact(PlayerController interactor)
        {
            bool flag = TextBoxManager.HasTextBox(this.talkPoint);

            if (!flag)
            {
                this.m_canUse = ((this.CanUse != null) ? this.CanUse(interactor, base.gameObject) : this.m_canUse);
                bool flag2 = !this.m_canUse;
                if (flag2)
                {
                    //TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 2f, "Please come back later", interactor.characterAudioSpeechTag, false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);/*
                    PlayableCharacters characterIdentity = interactor.characterIdentity;
                    bool flag3 = characterIdentity == PlayableCharacters.Robot;
                    if (flag3)
                    {
                        TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 2f, "Hey! You're not the right robot get out of here!", interactor.characterAudioSpeechTag, false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);
                    }
                    else
                    {
                        TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 2f, "The guy who programmed me was to lazy to let you undo this...", interactor.characterAudioSpeechTag, false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);
                    }

                    base.spriteAnimator.PlayForDuration("talk", 2f, "idle", false);
                }
                else
                {
                    base.StartCoroutine(this.HandleConversation(interactor));
                }
            }
        }
Example #4
0
    // Use this for initialization
    public void Init()
    {
        textboxManager = FindObjectOfType <TextBoxManager>();
        tutMode        = GetComponent <TutorialMode>();
        statsMenu      = GetComponent <Player2D_StatsMenu>();
        tutSpawn       = GetComponent <TutorialSpawn>();
        inventory      = GetComponent <Inventory>();

#if UNITY_EDITOR || UNITY_STANDALONE
        textboxManager.ReloadScript(theTextConsole);
#elif UNITY_ANDROID || UNITY_IPHONE
        textboxManager.ReloadScript(theTextMobile);
#endif
        textboxManager.currentLine = startLine;
        textboxManager.endAtLine   = endLine;
        textboxManager.EnableTextBox();

        MovedW      = false;
        MovedA      = false;
        MovedS      = false;
        MovedD      = false;
        chestOpened = false;
        triedPause  = triedPP = triedAttack = triedMove = triedCollecting = triedInventory = triedMerchant = triedTrap1 = triedTrap2 = triedTrap3 = triedTrap4 = false;
        pauseBox    = false;
    }
    private void Update()
    {
        if (heroOnTile && Input.GetButtonDown("AButton"))
        {
            if (currentlyStandingOnInteractableTile)
            {
                if (GameManager.gm.gameObject.GetComponent <Inventory>().ContainsItem(key.GetItemData()))
                {
                    BattleManager.isFightingFinalBoss = true;
                    BattleManager.bManager.StartBattle(new string[] { "Boo! Welcome to the castle of spook!" }, GameObject.Instantiate(BattleManager.bManager.areaEncounters.GetFinalBoss().gameObject).GetComponent <EnemyPartyManager>());

                    heroOnTile = false;
                }
                else
                {
                    TextBoxManager textManager = TextBoxManager.tbm;
                    textManager.currentLine = 0;
                    textManager.endLine     = 0;

                    GameManager.gm.leader.DisableMovement();

                    string lockedMessage = "A foreboding structure looms before you, but you still need a " + key.GetItemData().itemName + ".";
                    TextBoxManager.tbm.EnableTextBox(null, lockedMessage, true, false, true);


                    heroOnTile = false;
                    Debug.Log("Attempted opening");
                }
            }
            else
            {
                heroOnTile = false;
            }
        }
    }
Example #6
0
 // Use this for initialization
 void Start()
 {
     thePlayer    = FindObjectOfType <PlayerController>();
     levelExit    = FindObjectOfType <LevelLoader>();
     thePauseMenu = FindObjectOfType <PauseMenu>();
     theBox       = FindObjectOfType <TextBoxManager>();
 }
Example #7
0
        // Token: 0x06000068 RID: 104 RVA: 0x00004AB8 File Offset: 0x00002CB8
        public void Interact(PlayerController interactor)
        {
            bool flag  = TextBoxManager.HasTextBox(this.talkPoint);
            bool flag2 = !flag;

            if (flag2)
            {
                this.m_canUse = ((this.CanUse != null) ? this.CanUse(interactor, base.gameObject) : this.m_canUse);
                bool flag3 = this.m_canUse;
                bool flag4 = flag3;
                if (flag4)
                {
                    bool flagYEE = this.counterfoirfuckssakeWORK1 == 1f;
                    if (flagYEE)
                    {
                        TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 2f, "...", interactor.characterAudioSpeechTag, false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);
                        base.spriteAnimator.PlayForDuration("talk", 2f, "idle", false);
                    }
                    else
                    {
                        base.StartCoroutine(this.HandleConversation(interactor));
                    }
                }
            }
        }
Example #8
0
    // Use this for initialization
    void Start()
    {
        rigb    = GetComponent <Rigidbody2D>();
        textBox = dialogBox.GetComponent <TextBoxManager>();

        dialogBox.SetActive(false);
    }
Example #9
0
    void  Start()
    {
        playButtons = this.transform.Find("PlayButtons");
        yesButton   = playButtons.GetComponentInChildren <YesButton>();
        yesButton.AddEventListener(this.gameObject);
        noButton = playButtons.GetComponentInChildren <NoButton>();
        noButton.AddEventListener(this.gameObject);

        playButtons.active = false;

        bombChain       = this.transform.Find("BombChain").gameObject;
        maxHand         = this.transform.Find("MaxHand").GetComponent <Hand>();
        bombAttachSound = this.transform.Find("BombAttachSound").GetComponent <SoundObject>();
        maxHand.AddEventListener(this.gameObject);
        chainHand = this.transform.Find("ChainHand").GetComponent <Hand>();
        chainHand.AddEventListener(this.gameObject);

        textBoxManagerAfterFirstDialogue = this.transform.Find("TextBoxManagerAfterFirstDialogue").GetComponent <TextBoxManager>();
        textBoxManagerAfterFirstDialogue.AddEventListener(this.gameObject);

        textBoxManagerAfterFirstDialogue.active = false;

        playerControl = this.GetComponentInChildren <MenuPlayerControl>();
        maxHand.AddEventListener(playerControl.gameObject);

        AttachChainToMax();
    }
Example #10
0
    private void Update()
    {
        if (heroStandingOnThisTile && Input.GetButtonDown("AButton"))
        {
            if (currentlyStandingOnInteractableTile)
            {
                if (!hasBeenOpened)
                {
                    GameManager.gm.leader.DisableMovement();
                    TextBoxManager textManager = TextBoxManager.tbm;
                    textManager.currentLine = 0;
                    textManager.endLine     = 0; // Controls how many windows

                    string boxMessage = "Inside the chest, you found a " + treasure.GetItemData().itemName + ".";
                    TextBoxManager.tbm.EnableTextBox(null, boxMessage, true, false, true);
                    // TODO: Open box animation
                    GameManager.gm.gameObject.GetComponent <Inventory>().AddToInventory(treasure.GetItemData());


                    hasBeenOpened          = true;
                    heroStandingOnThisTile = false;

                    StartCoroutine(WaitUntilMessageDoneThenDestroy());
                }
                else
                {
                }
            }
            else
            {
                heroStandingOnThisTile = false;
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        rigi = GetComponent <Rigidbody>();
        cam  = GetComponent <Camera>();

        charMovement = GameObject.Find("main char").GetComponent <PlayerMovement>();
        player       = GameObject.Find("main char").transform;
        if (!outside)
        {
            clown     = FindObjectOfType <Eyes>().transform.parent;
            clownEyes = FindObjectOfType <Eyes>();

            textBoxMana = GameObject.Find("TextBoxManager").GetComponent <TextBoxManager>();
            faceLight   = GameObject.Find("face light").GetComponent <Light>();

            zoomedTrans        = GameObject.Find("zoom pos camera").transform;
            playerTalkingTrans = GameObject.Find("talking pos main char").transform;
        }
        overheadRot            = transform.rotation;
        offsetFromPlayer       = transform.position - player.position;
        RenderSettings.fogMode = FogMode.Exponential;
        //  RenderSettings.fogDensity = .015f;
        //  RenderSettings.fogColor = fogColor;
        camHeight = transform.position.y;
    }
        private IEnumerator DoYouTubeSafeAnnouncement(Vector3 DialogBoxOffset)
        {
            string[] m_Lyrics = new string[] {
                "Never gonna give you up!",
                "Never gonna let you down!",
                "Never gonna run around and desert you!",
                "Never gonna make you cry!"
            };
            yield return(new WaitForSeconds(0.5f));

            TextBoxManager.ShowTextBox(transform.position + DialogBoxOffset, transform, 5f, m_Lyrics[0], "rickrolldialog1", false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);
            yield return(new WaitForSeconds(2));

            TextBoxManager.ClearTextBox(transform);
            TextBoxManager.ShowTextBox(transform.position + DialogBoxOffset, transform, 5f, m_Lyrics[1], "rickrolldialog2", false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);
            yield return(new WaitForSeconds(2));

            TextBoxManager.ClearTextBox(transform);
            TextBoxManager.ShowTextBox(transform.position + DialogBoxOffset, transform, 5f, m_Lyrics[2], "rickrolldialog3", false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);
            yield return(new WaitForSeconds(2));

            TextBoxManager.ClearTextBox(transform);
            TextBoxManager.ShowTextBox(transform.position + DialogBoxOffset, transform, 5f, m_Lyrics[3], "rickrolldialog4", false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);
            yield return(new WaitForSeconds(2));

            TextBoxManager.ClearTextBox(transform);
            yield break;
        }
Example #13
0
 // Use this for initialization
 void Start()
 {
     _triggeredOnce       = false;
     _player              = GameObject.FindGameObjectWithTag("Player");
     theTextBox           = FindObjectOfType <TextBoxManager>();
     _tractorBeamControls = _player.GetComponent <TractorBeamControls> ();
 }
Example #14
0
 void Start()
 {
     _canRun            = true;
     _textBox           = GameObject.Find("TextBoxManager").GetComponent <TextBoxManager>();
     _spriteInformation = GetComponent <SpriteRenderer>();
     _anim = GetComponent <Animator>();
 }
Example #15
0
    // Use this for initialization
    void Start()
    {
        obeseGo        = false;
        midGo          = false;
        athGo          = false;
        transitionDone = false;
        givenCake      = false;
        teenEntered    = false;
        teenGo         = false;
        obeseGo        = false;
        middleGo       = false;
        athleticGo     = false;
        transit        = GameObject.FindGameObjectWithTag("Finish");
        transit.SetActive(false);
        resultScene = false;
        textScript  = GameObject.Find("FPSController").GetComponent <TextBoxManager>();


        kidTrans  = kid.GetComponent <Transform>();
        cakeTrans = cake.GetComponent <Transform>();
        carTrans  = car.GetComponent <Transform>();

        obeseTeenTrans    = obeseTeen.GetComponent <Transform>();
        athleticTeenTrans = athleticTeen.GetComponent <Transform>();
        middleTeenTrans   = middleTeen.GetComponent <Transform>();

        snackTrans     = snack.GetComponent <Transform>();
        makesnackTrans = makesnack.GetComponent <Transform>();
        bookTrans      = book.GetComponent <Transform>();
    }
Example #16
0
    public override void Use()
    {
        theTextBox = FindObjectOfType <TextBoxManager>();
        theTextBox.ReloadScript(fishingRodText);


        if (canFish)
        {
            audioManager = FindObjectOfType <AudioManager>();
            audioManager.PlaySFX(soundToPlay);

            theTextBox.fishing      = true;
            theTextBox.fishingTimer = 2f;

            theTextBox.currentLine = fishingLine;
            theTextBox.endAtLine   = fishingLine;

            theTextBox.EnableTextBox();
        }
        else
        {
            theTextBox.currentLine = noFishingLine;
            theTextBox.endAtLine   = noFishingLine;
        }

        theTextBox.EnableTextBox();
    }
Example #17
0
 // Use this for initialization
 void Start()
 {
     textBoxManager = textBox.GetComponent <TextBoxManager> ();
     storyPic       = storyImage.GetComponent <Image> ();
     enemyTMFinaly  = enemyTeamManager.GetComponent <EnemyTeamManager> ();
     door           = GameObject.Find("DoorInOut").GetComponent <Door> ();
 }
 // Use this for initialization
 void Start()
 {
     _triggeredOnce        = false;
     _shipPart             = GameObject.FindGameObjectWithTag("TetheredPart");
     theTextBox            = FindObjectOfType <TextBoxManager>();
     _tetheredObjectScript = _shipPart.GetComponent <TetheredObject> ();
 }
        public void Interact(PlayerController interactor)
        {
            bool flag = TextBoxManager.HasTextBox(this.talkPoint);

            if (!flag)
            {
                this.m_canUse = ((this.CanUse != null) ? this.CanUse(interactor, base.gameObject) : this.m_canUse);
                if (!this.m_canUse)
                {
                    base.spriteAnimator.PlayForDuration("talk", 2f, "idle", false);
                    TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 2f, "No... not this time.", interactor.characterAudioSpeechTag, false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);
                }
                else
                {
                    if (hasBeenUsedThisRun)
                    {
                        TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 2f, "Hmm? Oh, not now, sorry. I'm busy.", interactor.characterAudioSpeechTag, false, TextBoxManager.BoxSlideOrientation.NO_ADJUSTMENT, false, false);
                    }
                    else
                    {
                        if (interactor.HasPickupID(281))
                        {
                            base.StartCoroutine(this.HandleGungeonBlueprintConvo(interactor));
                        }
                        else
                        {
                            base.StartCoroutine(this.HandleConversation(interactor));
                        }
                    }
                }
            }
        }
Example #20
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            theTextBox = FindObjectOfType <TextBoxManager>();

            if (items == null || items.Count == 0)
            {
                theTextBox.ReloadScript(chestText);
                theTextBox.currentLine = emptyStartLine;
                theTextBox.endAtLine   = emptyEndLine;
                theTextBox.EnableTextBox();
            }
            else
            {
                foreach (var item in items)
                {
                    Inventory.instance.Add(item);
                }

                theTextBox.ReloadScript(chestText);
                theTextBox.currentLine = itemFoundStartLine;
                theTextBox.endAtLine   = itemFoundEndLine;
                theTextBox.EnableTextBox();

                items = null;

                DisableChest();
            }
        }
    }
Example #21
0
    // Use this for initialization
    void Start()
    {
        textBoxManager = FindObjectOfType <TextBoxManager> ();
        if (gameObject.GetComponent <BoxCollider2D> () == null)
        {
            Debug.LogWarning("No BoxCollider2D detected. Did you forget to attach it to GameObject?");
            isBoxCollider2D = false;
        }
        else if (gameObject.GetComponent <BoxCollider2D> () != null)
        {
            isBoxCollider2D = true;
        }

        if (gameObject.GetComponent <BoxCollider> () == null)
        {
            if (isBoxCollider2D == false)
            {
                Debug.LogWarning("No BoxCollider detected. Did you forget to attach it to GameObject?");
            }
            isBoxCollider = false;
        }
        else if (gameObject.GetComponent <BoxCollider> () != null)
        {
            isBoxCollider = true;
        }
    }
	void Start () {
		musicManager = FinalSceneMusicManager.getInstance ();
		musicManager.playTrack (0); //E1
		ghostSwitchManager = GetComponent<GhostSwitchManager> ();

		maincam = GameObject.FindGameObjectWithTag ("MainCamera");
		textBoxManager = FindObjectOfType < TextBoxManager >();

		player = GameObject.FindGameObjectWithTag ("Player");
		playerAnim = player.GetComponent<Animator>();
		playerController = player.GetComponent<Controller2> ();

		puppetMasterAnim = puppetMaster.GetComponent<Animator> ();
		puppetMasterFace("forward");
		puppetMaster.SetActive (false);
		isNameUpdated = false;

		humanAnim = human.GetComponent<Animator> ();
		humanController = human.GetComponent<Controller2> ();
		human.layer = 0;

		//TESTING
		//puppetMasterAnim.SetBool ("hasSoul", true);
		//StartCoroutine (temp ());
		//StartCoroutine (fifthTrigger ());
	}
        private IEnumerator HandleConversation(PlayerController interactor)
        {
            SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.black);
            base.spriteAnimator.PlayForDuration("talk_start", 1, "talk");
            interactor.SetInputOverride("npcConversation");
            Pixelator.Instance.LerpToLetterbox(0.35f, 0.25f);
            yield return(null);

            int conversationIndex = m_allowMeToIntroduceMyself ? 0 : conversation.Count - 1;

            while (conversationIndex < conversation.Count - 1)
            {
                Tools.Print($"Index: {conversationIndex}");
                TextBoxManager.ClearTextBox(this.talkPoint);
                TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, -1f, conversation[conversationIndex], interactor.characterAudioSpeechTag, instant: false, showContinueText: true);
                float timer = 0;
                while (!BraveInput.GetInstanceForPlayer(interactor.PlayerIDX).ActiveActions.GetActionFromType(GungeonActions.GungeonActionType.Interact).WasPressed || timer < 0.4f)
                {
                    timer += BraveTime.DeltaTime;
                    yield return(null);
                }
                conversationIndex++;
            }
            m_allowMeToIntroduceMyself = false;
            TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, -1f, conversation[conversation.Count - 1], interactor.characterAudioSpeechTag, instant: false, showContinueText: true);

            GameUIRoot.Instance.DisplayPlayerConversationOptions(interactor, null, acceptText, declineText);
            int selectedResponse = -1;

            while (!GameUIRoot.Instance.GetPlayerConversationResponse(out selectedResponse))
            {
                yield return(null);
            }

            if (selectedResponse == 0)
            {
                TextBoxManager.ClearTextBox(this.talkPoint);
                base.spriteAnimator.PlayForDuration("do_effect", -1, "talk");

                while (base.spriteAnimator.CurrentFrame < 20) //play do effect anim
                {
                    yield return(null);
                }
                OnAccept?.Invoke(interactor, this.gameObject);
                base.spriteAnimator.Play("talk");
                TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 1f, "Bam!", interactor.characterAudioSpeechTag, instant: false);
                yield return(new WaitForSeconds(1f));
            }
            else
            {
                OnDecline?.Invoke(interactor, this.gameObject);
                TextBoxManager.ClearTextBox(this.talkPoint);
            }

            // Free player and run OnAccept/OnDecline actions
            interactor.ClearInputOverride("npcConversation");
            Pixelator.Instance.LerpToLetterbox(1, 0.25f);
            base.spriteAnimator.Play("idle");
        }
Example #24
0
 // Use this for initialization
 void Start()
 {
     theTextBox = FindObjectOfType<TextBoxManager>();
     lightFlash.SetActive(false);
     step = new bool[50];
     siren.SetActive(false);
     x = Camera.main.transform.position.x;
 }
Example #25
0
    // Use this for initialization
    void Start()
    {
        /* Getting the Text Box Renderer */
        _theManager = GameObject.FindGameObjectWithTag("GameScript").GetComponent <TextBoxManager>();

        /* Buttons */
        m_buttons = GameObject.FindGameObjectWithTag("Holder").GetComponent <MerchantHolder>().Merchant_Interaction;
    }
    // Use this for initialization
    void Start()
    {
        theTextBox = FindObjectOfType <TextBoxManager>();

        GetComponent <AudioSource>().playOnAwake = false;
        GetComponent <AudioSource>().clip        = saw;
        test = true;
    }
Example #27
0
 public void Start()
 {
     _theTextManager = FindObjectOfType <TextBoxManager> ();
     if (Indicator != null)
     {
         Indicator.SetActive(false);
     }
 }
 private void Start()
 {
     savedRotation      = transform.rotation;
     saveOffsetPosition = offsetPosition;
     playerMovement     = target.gameObject.GetComponent <PlayerMovement>();
     managerScript      = textBoxManager.GetComponent <TextBoxManager>();
     moveState          = MoveState.Initial;
 }
Example #29
0
 public void Interact(PlayerController interactor)
 {
     if (TextBoxManager.HasTextBox(interactor.transform))
     {
         return;
     }
     base.StartCoroutine(this.HandleShrineConversation(interactor));
 }
 public override void OnExitRange(PlayerController interactor)
 {
     base.OnExitRange(interactor);
     if (TextBoxManager.HasTextBox(this.talkPoint))
     {
         TextBoxManager.ClearTextBox(this.talkPoint);
     }
 }
Example #31
0
    void Awake()
    {
        phone          = GameObject.Find("Phone");
        textBox        = GameObject.Find("TextBox");
        textBoxManager = GameObject.Find("TextBoxManager").GetComponent <TextBoxManager>();

        phone.SetActive(false);
    }
Example #32
0
 // Use this for initialization
 void Start()
 {
     transform.position = item[0].position;
     playerController   = FindObjectOfType <PlayerController>();
     equipGet           = FindObjectOfType <EquipGet>();
     menuManager        = FindObjectOfType <MenuManager>();
     textBoxManager     = FindObjectOfType <TextBoxManager>();
 }
Example #33
0
    void Start () {
        movePoint = GameObject.Find("DogMovePoint").transform;
        tBox = GameObject.Find("TextBoxManager").GetComponent<TextBoxManager>();
        anim = GetComponent<Animator>();
        anim.SetBool("right", true);
        canMove = false;
        addDescription = false;
	}
    //this is a tutotial script for level 1a
    void Start()
    {
        controller2 = GetComponent<Controller2>();
		textBoxManager = GameObject.FindObjectOfType<TextBoxManager> ();

		currentMessages = (Input.GetJoystickNames ().Length == 0) ? tutorialMessages : joyStickMessages;

		disableMessages (tutorialMessages);
		disableMessages (joyStickMessages);
		StartCoroutine ("ghostSwitchTutorial");
    }
Example #35
0
    private void Start()
    {
        // Setting up the reference.
		findPlayer();
        dollManager = FindObjectOfType<DollManager>();
		textBox = FindObjectOfType<TextBoxManager>();
        currentDollSpeed = dollManager.maxSpeed;

		// set the desired aspect ratio (the values in this example are
		// hard-coded for 16:9, but you could make them into public
		// variables instead so you can set them at design time)
		float targetaspect = 16.0f / 9.0f;

		// determine the game window's current aspect ratio
		float windowaspect = (float)Screen.width / (float)Screen.height;

		// current viewport height should be scaled by this amount
		float scaleheight = windowaspect / targetaspect;

		// obtain camera component so we can modify its viewport
		Camera camera = GetComponent<Camera>();

		// if scaled height is less than current height, add letterbox
		if (scaleheight < 1.0f)
		{  
			Rect rect = camera.rect;

			rect.width = 1.0f;
			rect.height = scaleheight;
			rect.x = 0;
			rect.y = (1.0f - scaleheight) / 2.0f;

			camera.rect = rect;
		}
		else // add pillarbox
		{
			float scalewidth = 1.0f / scaleheight;

			Rect rect = camera.rect;

			rect.width = scalewidth;
			rect.height = 1.0f;
			rect.x = (1.0f - scalewidth) / 2.0f;
			rect.y = 0;

			camera.rect = rect;
		}
    }
    // Use this for initialization
    void Start () {
		theTextBox = FindObjectOfType < TextBoxManager > ();
		triggeredCheck = GetComponent<checkOneTimeTrigger> ();
	}
	// Use this for initialization
	void Start () {
		pointer = -1;
		theTextBox = FindObjectOfType < TextBoxManager >();
	}
	// Use this for initialization
	void Start () {
        discontinueText = false;
        tBox = FindObjectOfType<TextBoxManager>();
        textBoxActivated = false;
	}
Example #39
0
	public TextBoxManager()
	{
		Inst = this;
	}
Example #40
0
	void Start () {
		found = GameManager.getInstance ().secretItemFound [index];
		checkDestroy ();
		manager = GameObject.FindGameObjectWithTag ("TextBoxManager").GetComponent<TextBoxManager> ();
	}
	void Start () 
	{
		textBoxManager = TextBoxManager.Inst;
	}
	// Use this for initialization
	void Start () {
        theTextBox = FindObjectOfType<TextBoxManager>();
	
	}
 void Start()
 {
     textBoxManagerObject = GameObject.Find("TextBoxManager");
     textBoxManager = (TextBoxManager) textBoxManagerObject.GetComponent("TextBoxManager");
 }
Example #44
0
	void Start () {
		textManager = FindObjectOfType<TextBoxManager> ();
	}
Example #45
0
    public Button[] allButtons; //All buttons to reselect and deselect in order for the selecting glitch to not happen. 


    // Use this for initialization
    void Start () {
		manager = GameObject.FindGameObjectWithTag ("TextBoxManager").GetComponent<TextBoxManager> ();
		Debug.Log (Input.GetJoystickNames().Length);
	}
Example #46
0
	void Start () {
		manager = GameObject.FindGameObjectWithTag ("TextBoxManager").GetComponent<TextBoxManager> ();
        pauseScrn_panel.SetActive(false);
        notebookManager.closeEverything();
        options_panel.SetActive(false);
	}
Example #47
0
 // Use this for initialization
 void Start()
 {
     tBox = FindObjectOfType<TextBoxManager>();
     inv = GameObject.Find("MainCharacter").GetComponentInChildren<Inventory>();
 }