Пример #1
0
        private EInputHandlerResult OnCameraZoomInput(float inInput)
        {
            if (CameraInterface != null)
            {
                CameraInterface.Zoom(inInput);
                return(EInputHandlerResult.Handled);
            }

            return(EInputHandlerResult.Unhandled);
        }
Пример #2
0
        private EInputHandlerResult OnCameraHorizontalInput(float inInput)
        {
            if (CameraInterface != null)
            {
                CameraInterface.RotateHorizontal(inInput);
                return(EInputHandlerResult.Handled);
            }

            return(EInputHandlerResult.Unhandled);
        }
Пример #3
0
        private EInputHandlerResult OnCameraZoomReset(bool isEnabled)
        {
            if (CameraInterface != null)
            {
                if (isEnabled)
                {
                    CameraInterface.ResetZoom();
                }

                return(EInputHandlerResult.Handled);
            }

            return(EInputHandlerResult.Unhandled);
        }
Пример #4
0
 public bool HandleMessage(int id, string mapName, GameObject param2)
 {
     if (mapName != null)
     {
         if (LoadMap(mapName))
         {
             if (id == MassageList.loadMap)
             {
                 Transform transform = RoleInterface.GetPlayer().transform;
                 SetPos(transform, param2);
                 CameraInterface.SetCameraPos(transform.position);
             }
             return(false);
         }
     }
     return(false);
 }
Пример #5
0
        /// <summary>
        /// Loads all needed ContentManager content.
        /// </summary>
        public void LoadContent(bool isReload, ContentManager contentManager, bool fromCompositor)
        {
            this.content = contentManager;

            if (!fromCompositor && !isReload)
            {
                ////////////////////////////////////////////////////////////////////////////
                // This must always remain the first entity created
                this.sceneMgrRootEntity      = new BaseEntity(this.Game);
                this.sceneMgrRootEntity.Name = "SceneMgr Root";

                this.AddEntity(sceneMgrRootEntity);
                ////////////////////////////////////////////////////////////////////////////

                this.cameraInterface = new CameraInterface(this.Game);
                AddInterface(this.cameraInterface);

                AddInterface(new PhysicsInterface(this.Game));

                AddInterface(new InputInterface(this.Game));

                this.entityLoader = new EntityLoader(this.Game);

                AddInterface(this.Game.Graphics);

                SetupBaseCamera();

                MsgSetGravity msgSetGrav = ObjectPool.Aquire <MsgSetGravity>();
                msgSetGrav.Gravity = new Vector3(0.0f, -60.00f, 0.0f);
                this.Game.SendInterfaceMessage(msgSetGrav, InterfaceType.Physics);

                // Start the first physics frame.
                MsgBeginPhysicsFrame msgBeginFrame = ObjectPool.Aquire <MsgBeginPhysicsFrame>();
                msgBeginFrame.GameTime = new GameTime();
                this.Game.SendInterfaceMessage(msgBeginFrame, InterfaceType.Physics);
            }
        }