Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How to solve it?

Discussion in 'Animation' started by wechat_os_Qy04zLlPW1r8odQMUfIdF0N9Q, Apr 5, 2021.

  1. wechat_os_Qy04zLlPW1r8odQMUfIdF0N9Q

    wechat_os_Qy04zLlPW1r8odQMUfIdF0N9Q

    Joined:
    Apr 5, 2021
    Posts:
    3
    #**How to solve it?**
    ***Lighting data asset ‘LightingData’ is inconsistent because 102 files out of 508 are missing. Please use Generate Lighting to rebuild the lighting data.***

    using System;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;

    public class UIQualityManager : MonoBehaviour
    {
    public Canvas canvas;


    public Dropdown dpPostProcessing;
    public Dropdown dpQuality;

    public Terrain terrain;

    public List<NameValue> detailDensities;
    public Dropdown dpDetailDensity;

    public List<NameValue> shapeQualities;
    public Dropdown dpShapeQuality;

    private void Start()
    {
    List<string> qualityOptions = new List<string>();
    qualityOptions.AddRange(QualitySettings.names);
    dpQuality.AddOptions(qualityOptions);
    dpQuality.value = dpQuality.options.Count - 1;

    List<string> postProcessing = new List<string>();
    dpPostProcessing.AddOptions(postProcessing);



    List<string> detailDensitiesList = new List<string>();
    foreach (var item in detailDensities)
    {
    detailDensitiesList.Add(item.name);
    }
    dpDetailDensity.AddOptions(detailDensitiesList);


    List<string> shapeQualitiesList = new List<string>();
    foreach (var item in shapeQualities)
    {
    shapeQualitiesList.Add(item.name);
    }
    dpShapeQuality.AddOptions(shapeQualitiesList);


    }

    private void Update()
    {
    if (Input.GetKeyDown(KeyCode.O))
    {
    canvas.enabled = !canvas.enabled;
    }
    }

    public void SetQuality(int id)
    {
    QualitySettings.SetQualityLevel(id);

    }

    public void SetDetailDensity(int id)
    {
    terrain.detailObjectDensity = detailDensities[id].value;
    terrain.Flush();
    }

    public void SetShapeQuality(int id)
    {
    terrain.heightmapPixelError = shapeQualities[id].value;
    terrain.Flush();
    }

    }

    [Serializable]
    public class NameValue
    {
    public float value;
    public string name;

    }
    ***I have already tried the ones above.***
    ##*And these are the instructions when i download it from the asset store*
    We advice to use deferred rendering with linear color space setup.
    - Linear color space: because all materials were setup to linear color rendering, at gamma they could be to intensive or simply render unproperly.
    - Deferred rendering: it's because reflection probes have blending distance setup, so whole surface will reflect environment properly.
    You could use forward rendering but probably reflection probes should be adjusted by additional "box size" range.
    Anyway best performance at this project you will get with deffered rendering and linear color space.

    If you will import full versions of the packs (from asset store) which we use to build this scene, they should automatically replace correct
    files and give full resolution HQ view.
    ##*Here is the Extended Flycam.*
    using UnityEngine;
    using System.Collections;

    public class ExtendedFlycam : MonoBehaviour
    {

    /*
    EXTENDED FLYCAM
    Desi Quintans (CowfaceGames.com), 17 August 2012.
    Based on FlyThrough.js by Slin (http://wiki.unity3d.com/index.php/FlyThrough), 17 May 2011.

    LICENSE
    Free as in speech, and free as in beer.

    FEATURES
    WASD/Arrows: Movement
    Q: Climb
    E: Drop
    Shift: Move faster
    Control: Move slower
    End: Toggle cursor locking to screen (you can also press Ctrl+P to toggle play mode on and off).
    */

    public float cameraSensitivity = 90;
    public float climbSpeed = 4;
    public float normalMoveSpeed = 10;
    public float slowMoveFactor = 0.25f;
    public float fastMoveFactor = 3;

    private float rotationX = 0.0f;
    private float rotationY = 0.0f;

    void Start()
    {
    // Screen.lockCursor = true;
    }

    void Update()
    {
    rotationX += Input.GetAxis("Mouse X") * cameraSensitivity * Time.deltaTime;
    rotationY += Input.GetAxis("Mouse Y") * cameraSensitivity * Time.deltaTime;
    rotationY = Mathf.Clamp(rotationY, -90, 90);

    transform.localRotation = Quaternion.AngleAxis(rotationX, Vector3.up);
    transform.localRotation *= Quaternion.AngleAxis(rotationY, Vector3.left);

    if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
    {
    transform.position += transform.forward * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("Vertical") * Time.deltaTime;
    transform.position += transform.right * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("Horizontal") * Time.deltaTime;
    }
    else if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
    {
    transform.position += transform.forward * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("Vertical") * Time.deltaTime;
    transform.position += transform.right * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("Horizontal") * Time.deltaTime;
    }
    else
    {
    transform.position += transform.forward * normalMoveSpeed * Input.GetAxis("Vertical") * Time.deltaTime;
    transform.position += transform.right * normalMoveSpeed * Input.GetAxis("Horizontal") * Time.deltaTime;
    }


    if (Input.GetKey(KeyCode.Q)) { transform.position += transform.up * climbSpeed * Time.deltaTime; }
    if (Input.GetKey(KeyCode.E)) { transform.position -= transform.up * climbSpeed * Time.deltaTime; }

    if (Input.GetKeyDown(KeyCode.End))
    {
    if (Cursor.lockState == CursorLockMode.None)
    Cursor.lockState = CursorLockMode.Locked;
    else
    Cursor.lockState = CursorLockMode.None;

    }
    }
    }
     
    Last edited: Apr 5, 2021
  2. wechat_os_Qy04zLlPW1r8odQMUfIdF0N9Q

    wechat_os_Qy04zLlPW1r8odQMUfIdF0N9Q

    Joined:
    Apr 5, 2021
    Posts:
    3
     
  3. wechat_os_Qy04zLlPW1r8odQMUfIdF0N9Q

    wechat_os_Qy04zLlPW1r8odQMUfIdF0N9Q

    Joined:
    Apr 5, 2021
    Posts:
    3
    Code (CSharp):
    1. #**How to solve it?**
    2.  
    3. ***Lighting data asset ‘LightingData’ is inconsistent because 102 files out of 508 are missing.  Please use Generate Lighting to rebuild the lighting data.***
    4.  
    5. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    6.  
    7.     using System;
    8.     using System.Collections.Generic;
    9.     using UnityEngine;
    10.     using UnityEngine.UI;
    11.    
    12.     public class UIQualityManager : MonoBehaviour
    13.     {
    14.         public Canvas canvas;
    15.    
    16.    
    17.         public Dropdown dpPostProcessing;
    18.         public Dropdown dpQuality;
    19.    
    20.         public Terrain terrain;
    21.    
    22.         public List<NameValue> detailDensities;
    23.         public Dropdown dpDetailDensity;
    24.    
    25.         public List<NameValue> shapeQualities;
    26.         public Dropdown dpShapeQuality;
    27.    
    28.         private void Start()
    29.         {
    30.             List<string> qualityOptions = new List<string>();
    31.             qualityOptions.AddRange(QualitySettings.names);
    32.             dpQuality.AddOptions(qualityOptions);
    33.             dpQuality.value = dpQuality.options.Count - 1;
    34.    
    35.             List<string> postProcessing = new List<string>();
    36.             dpPostProcessing.AddOptions(postProcessing);
    37.    
    38.    
    39.    
    40.             List<string> detailDensitiesList = new List<string>();
    41.             foreach (var item in detailDensities)
    42.             {
    43.                 detailDensitiesList.Add(item.name);
    44.             }
    45.             dpDetailDensity.AddOptions(detailDensitiesList);
    46.    
    47.    
    48.             List<string> shapeQualitiesList = new List<string>();
    49.             foreach (var item in shapeQualities)
    50.             {
    51.                 shapeQualitiesList.Add(item.name);
    52.             }
    53.             dpShapeQuality.AddOptions(shapeQualitiesList);
    54.    
    55.    
    56.         }
    57.    
    58.         private void Update()
    59.         {
    60.             if (Input.GetKeyDown(KeyCode.O))
    61.             {
    62.                 canvas.enabled = !canvas.enabled;
    63.             }
    64.         }
    65.    
    66.         public void SetQuality(int id)
    67.         {
    68.             QualitySettings.SetQualityLevel(id);
    69.    
    70.         }
    71.    
    72.         public void SetDetailDensity(int id)
    73.         {
    74.             terrain.detailObjectDensity = detailDensities[id].value;
    75.             terrain.Flush();
    76.         }
    77.    
    78.         public void SetShapeQuality(int id)
    79.         {
    80.             terrain.heightmapPixelError = shapeQualities[id].value;
    81.             terrain.Flush();
    82.         }
    83.    
    84.     }
    85.    
    86.     [Serializable]
    87.     public class NameValue
    88.     {
    89.         public float value;
    90.         public string name;
    91.    
    92.     }
    93. ***I have already tried the ones above.***
    94.  
    95. ##*And these are the instructions when i download it from the asset store*
    96.  
    97.     We advice to use deferred rendering with linear color space setup.
    98.     - Linear color space: because all materials were setup to linear color rendering, at gamma they could be to intensive or simply render unproperly.
    99.     - Deferred rendering: it's because reflection probes have  blending distance setup, so whole surface will reflect environment properly.
    100.    You could use forward rendering but probably reflection probes should be adjusted by additional "box size" range.
    101.    Anyway best performance at this project you will get with deffered rendering and linear color space.
    102.  
    103.    If you will import full versions of the packs (from asset store) which we use to build this scene, they should automatically replace correct
    104.    files and give full resolution HQ view.
    105.  
    106. ##*Here is the Extended Flycam.*
    107.  
    108.    using UnityEngine;
    109.    using System.Collections;
    110.  
    111.    public class ExtendedFlycam : MonoBehaviour
    112.    {
    113.  
    114.        /*
    115.        EXTENDED FLYCAM
    116.            Desi Quintans (CowfaceGames.com), 17 August 2012.
    117.            Based on FlyThrough.js by Slin (http://wiki.unity3d.com/index.php/FlyThrough), 17 May 2011.
    118.    
    119.        LICENSE
    120.            Free as in speech, and free as in beer.
    121.    
    122.        FEATURES
    123.            WASD/Arrows:    Movement
    124.                      Q:    Climb
    125.                      E:    Drop
    126.                          Shift:    Move faster
    127.                        Control:    Move slower
    128.                            End:    Toggle cursor locking to screen (you can also press Ctrl+P to toggle play mode on and off).
    129.        */
    130.  
    131.        public float cameraSensitivity = 90;
    132.        public float climbSpeed = 4;
    133.        public float normalMoveSpeed = 10;
    134.        public float slowMoveFactor = 0.25f;
    135.        public float fastMoveFactor = 3;
    136.  
    137.        private float rotationX = 0.0f;
    138.        private float rotationY = 0.0f;
    139.  
    140.        void Start()
    141.        {
    142.            //  Screen.lockCursor = true;
    143.        }
    144.  
    145.        void Update()
    146.        {
    147.            rotationX += Input.GetAxis("Mouse X") * cameraSensitivity * Time.deltaTime;
    148.            rotationY += Input.GetAxis("Mouse Y") * cameraSensitivity * Time.deltaTime;
    149.            rotationY = Mathf.Clamp(rotationY, -90, 90);
    150.  
    151.            transform.localRotation = Quaternion.AngleAxis(rotationX, Vector3.up);
    152.            transform.localRotation *= Quaternion.AngleAxis(rotationY, Vector3.left);
    153.  
    154.            if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
    155.            {
    156.                transform.position += transform.forward * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("Vertical") * Time.deltaTime;
    157.                transform.position += transform.right * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("Horizontal") * Time.deltaTime;
    158.            }
    159.            else if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
    160.            {
    161.                transform.position += transform.forward * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("Vertical") * Time.deltaTime;
    162.                transform.position += transform.right * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("Horizontal") * Time.deltaTime;
    163.            }
    164.            else
    165.            {
    166.                transform.position += transform.forward * normalMoveSpeed * Input.GetAxis("Vertical") * Time.deltaTime;
    167.                transform.position += transform.right * normalMoveSpeed * Input.GetAxis("Horizontal") * Time.deltaTime;
    168.            }
    169.  
    170.  
    171.            if (Input.GetKey(KeyCode.Q)) { transform.position += transform.up * climbSpeed * Time.deltaTime; }
    172.            if (Input.GetKey(KeyCode.E)) { transform.position -= transform.up * climbSpeed * Time.deltaTime; }
    173.  
    174.            if (Input.GetKeyDown(KeyCode.End))
    175.            {
    176.                if (Cursor.lockState == CursorLockMode.None)
    177.                    Cursor.lockState = CursorLockMode.Locked;
    178.                else
    179.                    Cursor.lockState = CursorLockMode.None;
    180.  
    181.            }
    182.        }
    183.    }
    184.  
     
unityunity