Beispiel #1
0
        /// <summary>
        /// Creates an instance of the player's character and sets
        /// time from the character's variables.
        /// </summary>
        public GameEvents(string selectedCharacter, InterfaceManager iManager, Cutscene cutscene, GameObject character, GameController controller)
        {
            this.selectedCharacter = selectedCharacter;
            this.iManager          = iManager;
            this.cutscene          = cutscene;
            this.controller        = controller;

            switch (selectedCharacter)
            {
            case "Jarno":
                player = new Jarno();
                character.transform.position = new Vector2(character.transform.position.x, player.height);
                break;

            case "Make":
                player = new Make();
                character.transform.position = new Vector2(character.transform.position.x, player.height);
                break;

            case "Teddy":
                player = new Teddy();
                character.transform.position = new Vector2(character.transform.position.x, player.height);
                break;
            }
            this.hour   = player.hour;
            this.minute = player.minute;
            controller.ChangeSkyBox(hour);
            player.events = this;
        }
Beispiel #2
0
 /// <summary>
 /// Finds all the necessary GameObjects and player from Events.
 /// </summary>
 private void getObjects()
 {
     character       = GameObject.Find("Player");
     info            = GameObject.Find("Info").GetComponent <Text>();
     door            = FindObjectOfType <Door>();
     npcType         = FindObjectOfType <NPCType>();
     tahti           = FindObjectOfType <Tahti>();
     blackjack       = FindObjectOfType <Blackjack>();
     iManager        = FindObjectOfType <InterfaceManager>();
     cutscene        = FindObjectOfType <Cutscene>();
     barfight        = FindObjectOfType <BarFight>();
     playerInventory = FindObjectOfType <Inventory>();
 }