Esempio n. 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();
            }
        }
Esempio n. 2
0
        /**
         * Clears the command queue.
         */
        public static void Clear()
        {
            CommandQueue commandQueue = Game.GetInstance().commandQueue;

            commandQueue.Clear();
        }