示例#1
0
    void Start()
    {
        cameraViewType = CameraViewType.Top;
        player.transform.localScale = Vector3.one * 0.25f * cityBuilder.globalScale;

        volumetricFog = mainCamera.GetComponent <VolumetricFog>();

        restartGame();
    }
    // Use this for initialization
    void Awake()
    {
        Data = new Dictionary <float, List <CSVData> >();

        _animator = GetComponent <Animator>();

        VolumetricFog fog = Camera.main.gameObject.GetComponent <VolumetricFog>();

        StartCoroutine(!BenchMark ? StartBenchMarks() : Fps());
    }
    override public void OnInspectorGUI()
    {
        if (!VolumetricFog.CheckSupport())
        {
            EditorGUILayout.HelpBox(VolumetricFog.GetUnsupportedErrorMessage(), MessageType.Error);
            return;
        }

        DrawDefaultInspector();
    }
示例#4
0
        public static void GX_WorldEdge()
        {
            VolumetricFog fog = CheckFog();

            if (fog == null)
            {
                return;
            }
            fog.preset = FOG_PRESET.WorldEdge;
            fog.preset = FOG_PRESET.Custom;             // enable to make modifications and preserve them
        }
示例#5
0
        public static void GX_SeaOfClouds()
        {
            VolumetricFog fog = CheckFog();

            if (fog == null)
            {
                return;
            }
            fog.preset = FOG_PRESET.SeaClouds;
            fog.preset = FOG_PRESET.Custom;             // enable to make modifications and preserve them
        }
示例#6
0
        public static void GX_FrostedWater()
        {
            VolumetricFog fog = CheckFog();

            if (fog == null)
            {
                return;
            }
            fog.preset = FOG_PRESET.FrostedGround;
            fog.preset = FOG_PRESET.Custom;             // enable to make modifications and preserve them
            fog.color  = Color.white;
            fog.height = 1.5f;
        }
示例#7
0
        static VolumetricFog CheckFog()
        {
            VolumetricFog fog = VolumetricFog.instance;

            // Checks Volumetric Fog image effect is attached
            if (fog == null)
            {
                Camera camera = Camera.main;
                if (camera == null)
                {
                    camera = FindObjectOfType <Camera>();
                }
                if (camera == null)
                {
                    Debug.LogError("Could not find camera to add camera effects to. Please add a camera to your scene.");
                    return(null);
                }
                fog = camera.gameObject.AddComponent <VolumetricFog>();
            }
            // Finds a suitable Sun light
            if (fog.sun == null)
            {
                Light[] lights = FindObjectsOfType <Light>();
                for (int k = 0; k < lights.Length; k++)
                {
                    Light light = lights[k];
                    if (light.name.Equals("Sun"))
                    {
                        fog.sun = light.gameObject;
                        break;
                    }
                }
                if (fog.sun == null)
                {
                    for (int k = 0; k < lights.Length; k++)
                    {
                        Light light = lights[k];
                        if (light.type == LightType.Directional)
                        {
                            fog.sun = light.gameObject;
                            break;
                        }
                    }
                }
            }
            return(fog);
        }
示例#8
0
 public override void OnEnable()
 {
     base.OnEnable();
     VolumetricFog = Mono.GetComponentInChildren <VolumetricFog>();
     EnableFog(false);
 }
示例#9
0
 public void setVolumetricFog(VolumetricFog fog)
 {
     this.fog = fog;
 }