Esempio n. 1
0
 public Vagon(int num) {
     middleWindow = new LargeWindow(mWPeople);
     leftWindow = new SmallWindow(lWPeople);
     rightWindow = new SmallWindow(rWPeople);
     leftDoor = new Door(lDPeopleInside, num * 2, leftWindow, middleWindow);
     rightDoor = new Door(rDPeopleInside, num * 2 + 1, rightWindow, middleWindow);
 }
Esempio n. 2
0
 public void FusRoDah()   //орем, громко орем
 {
     if (currentDoor != null)
     {
         Door        door = currentDoor;
         LargeWindow lwnd = door.getLwnd();
         SmallWindow swnd = door.getSwnd();
         Debug.Log("FUS");
         stats();
         if (lwnd.isFree())
         {
             door.ComingToWindow(lwnd, System.Math.Min(door.getPeopleInside(), lwnd.getPeopleFree()));
             Debug.Log("Ro2 " + door.getPeopleInside() + " Ro2 " + lwnd.getPeopleFree());
         }
         if (door.getPeopleInside() != 0)
         {
             if (swnd.isFree())
             {
                 door.ComingToWindow(swnd, System.Math.Min(door.getPeopleInside(), lwnd.getPeopleFree()));
                 Debug.Log("Ro3 " + door.getPeopleInside() + " Ro2 " + lwnd.getPeopleFree());
             }
         }
         Debug.Log("Ro" + door.getPeopleInside());
         stats();
     }
     else
     {
         Debug.Log("Error: currentDoor isnt pick");
     }
 }
Esempio n. 3
0
 public Door(int startPeopleInside, int num, SmallWindow pswnd, LargeWindow plwnd)
 {
     peopleInside = startPeopleInside;
     n            = num;
     swnd         = pswnd;
     lwnd         = plwnd;
 }
Esempio n. 4
0
    void Start()
    {
        Robot      = GameObject.Find("Robot");
        script     = this.GetComponent <SmallWindow>();
        modeAdd    = true;
        modeRemove = false;

        PosMass    = new Vector3(0f, 0f, 0f);
        TotallMass = GameObject.Find("Root").GetComponent <Data>().Mass;
    }
        public void Shutdown()
        {
            // Release the camera object.
            Camera = null;

            // Release the glow shader object.
            GlowShader?.ShutDown();
            GlowShader = null;
            // Release the glow map shader object.
            GlowMapShader?.ShutDown();
            GlowMapShader = null;
            // Release the full screen ortho window object.
            FullScreenWindow?.Shutdown();
            FullScreenWindow = null;
            // Release the small ortho window object.
            SmallWindow?.Shutdown();
            SmallWindow = null;
            // Release the up sample render to texture object.
            UpSampleTexure?.Shutdown();
            UpSampleTexure = null;
            // Release the vertical blur render to texture object.
            VerticalBlurTexture?.Shutdown();
            VerticalBlurTexture = null;
            // Release the vertical blur shader object.
            VerticalBlurShader?.ShutDown();
            VerticalBlurShader = null;
            // Release the horizontal blur render to texture object.
            HorizontalBlurTexture?.Shutdown();
            HorizontalBlurTexture = null;
            // Release the horizontal blur shader object.
            HorizontalBlurShader?.ShutDown();
            HorizontalBlurShader = null;
            // Release the small ortho window object.
            SmallWindow?.Shutdown();
            SmallWindow = null;
            // Release the down sample render to texture object.
            DownSampleTexture?.Shutdown();
            DownSampleTexture = null;
            // Release the render to texture object.
            RenderTexture?.Shutdown();
            RenderTexture = null;
            // Release the model object.
            BitMap?.Shutdown();
            BitMap = null;
            // Release the texture shader object.
            TextureShader?.ShutDown();
            TextureShader = null;
            // Release the Direct3D object.
            D3D?.ShutDown();
            D3D = null;
        }
Esempio n. 6
0
        private bool RenderHorizontalBlurToTexture()
        {
            // Store the screen width in a float that will be used in the horizontal blur shader.
            float screenSizeX = 1024.0f / 2;

            // Set the render target to be the render to texture.
            HorizontalBlurTexture.SetRenderTarget(D3D.DeviceContext);

            // Clear the render to texture.
            HorizontalBlurTexture.ClearRenderTarget(D3D.DeviceContext, 0.0f, 0.0f, 0.0f, 1.0f);

            // Generate the view matrix based on the camera's position.
            Camera.Render();

            // Get the world and view matrices from the camera and d3d objects.
            Matrix cameraViewMatrix = Camera.BaseViewMatrix;
            Matrix worldMatrix      = D3D.WorldMatrix;

            // Get the ortho matrix from the render to texture since texture has different dimensions.
            Matrix orthoMatrix = HorizontalBlurTexture.OrthoMatrix;

            // Turn off the Z buffer to begin all 2D rendering.
            D3D.TurnZBufferOff();

            // Put the small ortho window vertex and index buffers on the graphics pipeline to prepare them for drawing.
            if (!SmallWindow.Render(D3D.DeviceContext))
            {
                return(false);
            }

            // Render the small ortho window using the horizontal blur shader and the down sampled render to texture resource.
            if (!HorizontalBlurShader.Render(D3D.DeviceContext, SmallWindow.IndexCount, worldMatrix, cameraViewMatrix, orthoMatrix, DownSampleTexure.ShaderResourceView, screenSizeX))
            {
                return(false);
            }

            // Turn the Z buffer back on now that all 2D rendering has completed.
            D3D.TurnZBufferOn();

            // Reset the render target back to the original back buffer and not the render to texture anymore.
            D3D.SetBackBufferRenderTarget();

            // Reset the viewport back to the original.
            D3D.ResetViewPort();

            return(true);
        }
        private bool DownSampleTextureMethod()
        {
            // Set the render target to be the render to texture.
            DownSampleTexture.SetRenderTarget(D3D.DeviceContext);

            // Clear the render to texture.
            DownSampleTexture.ClearRenderTarget(D3D.DeviceContext, 0.0f, 1.0f, 0.0f, 1.0f);

            // Generate the view matrix based on the camera's position.
            Camera.Render();

            // Get the world and view matrices from the camera and d3d objects.
            Matrix worldMatrix = D3D.WorldMatrix;
            Matrix viewMatrix  = Camera.ViewMatrix;

            // Get the ortho matrix from the render to texture since texture has different dimensions being that it is smaller.
            Matrix orthoMatrix = DownSampleTexture.OrthoMatrix;

            // Turn off the Z buffer to begin all 2D rendering.
            D3D.TurnZBufferOff();

            // Put the small ortho window vertex and index buffers on the graphics pipeline to prepare them for drawing.
            if (!SmallWindow.Render(D3D.DeviceContext))
            {
                return(false);
            }

            // Render the small ortho window using the texture shader and the render to texture of the scene as the texture resource.
            if (!TextureShader.Render(D3D.DeviceContext, SmallWindow.IndexCount, worldMatrix, viewMatrix, orthoMatrix, RenderTexture.ShaderResourceView))
            {
                return(false);
            }

            // Turn the Z buffer back on now that all 2D rendering has completed.
            D3D.TurnZBufferOn();

            // Reset the render target back to the original back buffer and not the render to texture anymore.
            D3D.SetBackBufferRenderTarget();

            // Reset the viewport back to the original.
            D3D.ResetViewPort();

            return(true);
        }
Esempio n. 8
0
        public void Shutdown()
        {
            // Release the light object.
            Light = null;
            // Release the camera object.
            Camera = null;

            // Release the soft shadow shader object.
            SoftShadowShader?.ShutDown();
            SoftShadowShader = null;
            // Release the full screen ortho window object.
            FullScreenWindow?.Shutdown();
            FullScreenWindow = null;
            // Release the up sample render to texture object.
            UpSampleTexure?.Shutdown();
            UpSampleTexure = null;
            // Release the vertical blur shader object.
            VerticalBlurShader?.ShutDown();
            VerticalBlurShader = null;
            // Release the vertical blur render to texture object.
            VerticalBlurTexture?.Shutdown();
            VerticalBlurTexture = null;
            // Release the horizontal blur shader object.
            HorizontalBlurShader?.ShutDown();
            HorizontalBlurShader = null;
            // Release the horizontal blur render to texture object.
            HorizontalBlurTexture?.Shutdown();
            HorizontalBlurTexture = null;
            // Release the texture shader object.
            TextureShader?.ShutDown();
            TextureShader = null;
            // Release the small ortho window object.
            SmallWindow?.Shutdown();
            SmallWindow = null;
            // Release the down sample render to texture object.
            DownSampleTexure?.Shutdown();
            DownSampleTexure = null;
            // Release the shadow shader object.
            ShadowShader?.ShutDown();
            ShadowShader = null;
            // Release the black and white render to texture.
            BlackWhiteRenderTexture?.Shutdown();
            BlackWhiteRenderTexture = null;
            // Release the depth shader object.
            DepthShader?.ShutDown();
            DepthShader = null;
            /// Release the render to texture object.
            RenderTexture?.Shutdown();
            RenderTexture = null;
            // Release the ground model object.
            GroundModel?.Shutdown();
            GroundModel = null;
            // Release the sphere model object.
            SphereModel?.Shutdown();
            SphereModel = null;
            // Release the cube model object.
            CubeModel?.Shutdown();
            CubeModel = null;
            // Release the Direct3D object.
            D3D?.ShutDown();
            D3D = null;
        }
Esempio n. 9
0
 // RectTransform _rect;
 void Start()
 {
     singleton = this;
 }
Esempio n. 10
0
 void OnEnable()
 {
     singleton = this;
 }
Esempio n. 11
0
 // RectTransform _rect;
 void Start()
 {
     singleton = this;
 }
Esempio n. 12
0
 void OnEnable()
 {
     singleton = this;
 }