Example #1
0
        public virtual void Start()
        {
            // Add components for additional game functionality
            commandQueue     = gameObject.AddComponent <CommandQueue>();
            cameraController = gameObject.AddComponent <CameraController>();
            pageController   = gameObject.AddComponent <PageController>();

            AudioSource audioSource = gameObject.AddComponent <AudioSource>();

            audioSource.playOnAwake = false;
            audioSource.loop        = true;

            // Auto-hide buttons should be visible at start of game
            autoHideButtonTimer = autoHideButtonDuration;

            if (activeRoom == null)
            {
                // Pick first room found if none is specified
                activeRoom = GameObject.FindObjectOfType(typeof(Room)) as Room;
            }

            if (activeRoom != null)
            {
                // Move to the active room
                commandQueue.Clear();
                commandQueue.AddCommand(new Command.MoveToRoom(activeRoom));
                commandQueue.Execute();
            }
        }
Example #2
0
        /**
         * Executes the commadns in the command queue.
         */
        public static void Execute()
        {
            CommandQueue commandQueue = Game.GetInstance().commandQueue;

            commandQueue.Execute();
        }