Exemplo n.º 1
0
        private static PostProcessorInfo FindPostProcessorInfo(PostProcessInfo postProcessInfo, string postProcessorName)
        {
            var postProcessorInfo = postProcessInfo.PostProcessorInfos.SingleOrDefault(p => p.Name == postProcessorName);

            if (postProcessorInfo == null)
            {
                throw new DocfxException($"Could not find post processor info with name {postProcessorName}.");
            }

            return(postProcessorInfo);
        }
        private PostProcessInfo GeneratePostProcessInfo()
        {
            var postProcessInfo = new PostProcessInfo();

            postProcessInfo.PostProcessorInfos.AddRange(_postProcessors.Select(
                                                            postProcessor =>
                                                            new PostProcessorInfo
            {
                Name = postProcessor.ContractName,
                IncrementalContextHash =
                    ((ISupportIncrementalPostProcessor)postProcessor.Processor).GetIncrementalContextHash(),
            }).ToList());

            return(postProcessInfo);
        }
Exemplo n.º 3
0
    public void RegisterPostProcessVolume(PostProcessInfo v, bool startActive)
    {
        DestroyPostProcessVolume();

        Transform objectToApply = v.PostProcessObjectsContainer?.transform ?? v.Volume.transform;

        objectToApply.parent = this.transform.parent;

        if (v.ChildCamera != null)
        {
            v.ChildCamera.transform.position = Camera.transform.position;
            v.ChildCamera.orthographicSize   = Camera.orthographicSize;
        }
        PostProcessInfo = v;
        objectToApply.gameObject.SetActive(startActive);
    }
Exemplo n.º 4
0
    void Awake()
    {
        Screen.orientation = ScreenOrientation.Portrait;

        if (CameraManager.Instance.CameraController == null)
        {
            CameraManager.Instance.Create(MainCameraPrefab, true);
        }
        GameManager  gm = GameManager.Instance;        // create the game and music managers as well
        MusicManager mm = MusicManager.Instance;

        int buildIndex = this.gameObject.scene.buildIndex;

        if (buildIndex == SceneHelpers.LoadSceneBuildIndex)
        {
            return;
        }
        bool isMenu = buildIndex == SceneHelpers.MenuBuildIndex;

        ppv = GameObject.FindObjectsOfType <PostProcessVolume>().FirstOrDefault(p =>
                                                                                LayerMask.LayerToName(p.gameObject.layer) == "PostProcessing" &&
                                                                                p.gameObject.scene.name == this.gameObject.scene.name);
        if (ppv != null)
        {
            PostProcessInfo info = new PostProcessInfo(ppv);
            if (CameraManager.Instance.CameraController.PostProcessInfo == null ||
                info.Type != CameraManager.Instance.CameraController.PostProcessInfo.Type)
            {
                CameraManager.Instance.CameraController.RegisterPostProcessVolume(info, isMenu);
            }
            else
            {
                var objectToRemove = info.PostProcessObjectsContainer?.gameObject ?? info.Volume.gameObject;
                objectToRemove.Destroy();
            }
        }
        else
        {
            CameraManager.Instance.CameraController.DestroyPostProcessVolume();
        }

        // this needs to exist to modify android manifest to allow vibrations
        if (gm == null)
        {
            Handheld.Vibrate();
        }
    }