Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Apr 18, 2021 at 07:05 PM by wolfgangmami for the following reason:

I solved it somehow

avatar image
0
Question by wolfgangmami · Apr 15, 2021 at 11:41 PM · buildresourcesitemitemsprogramming-basics

Resources folder items not in the build

Hi I made some images and audio-mixers in resources folder to use later. As in the title, after the build. My items not in the folder and some of my scripts are giving error, because of that. How can I fix this issue?

edit(moved from comment)

If someone wonders to look my code (Maybe code is messed. But so far works great and I'm focusing to implementing. After that I'll do the cleanup )

 using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using TMPro;
 using UnityEngine;
 using UnityEngine.Audio;
 using UnityEngine.EventSystems;
 using UnityEngine.Rendering.HighDefinition;
 using UnityEngine.UI;
 
 public class Main_Menu : MonoBehaviour
 {
     internal GameObject[] _buttons, _texts, _sliders, _shutters;
     static TextMeshProUGUI _screentext;
     static int _sliderIndex;
     static GameObject[] _sound_sliders;
     internal TextMeshProUGUI _vsynctext, _graphicstext, _AA_result, _AA_sub_result;
     public List<GameObject> _graphicsbuttonslist, _vsyncbuttonslist, _AA_buttonslist, _AA_subbuttonslist;
     internal HDAdditionalCameraData _camera;
     Resolution[] _resolutions;
     public Dropdown _res_dropdown;
     AudioMixer[] _mixer;
     public GameObject[] _changer_buttons, _ReMappers;
     Slider _mouse_slider;
     Image _img;
 
     void Start()
     {
         _shutters = GameObject.FindGameObjectsWithTag("Shutters");
         #region Buttons Finder
         _AA_buttonslist.Insert(0, GameObject.Find("None"));
         _AA_buttonslist.Insert(1, GameObject.Find("Fxaa"));
         _AA_buttonslist.Insert(2, GameObject.Find("Taa"));
         _AA_buttonslist.Insert(3, GameObject.Find("Smaa"));
 
         _AA_subbuttonslist.Insert(0, GameObject.Find("AA_Low"));
         _AA_subbuttonslist.Insert(1, GameObject.Find("AA_Medium"));
         _AA_subbuttonslist.Insert(2, GameObject.Find("AA_High"));
 
         _graphicsbuttonslist.Insert(0, GameObject.Find("Low"));
         _graphicsbuttonslist.Insert(1, GameObject.Find("Medium"));
         _graphicsbuttonslist.Insert(2, GameObject.Find("High"));
 
         _vsyncbuttonslist.Insert(0, GameObject.Find("No_Limit"));
         _vsyncbuttonslist.Insert(1, GameObject.Find("60fps"));
         _vsyncbuttonslist.Insert(2, GameObject.Find("30fps"));
         #endregion
 
         _img = GameObject.Find("Background_Image").gameObject.GetComponent<Image>();
         _img.sprite = Resources.Load<Sprite>("apartment");
 
         _mixer = new AudioMixer[Universal_Properties._mixer_counter.Length];
         _mixer[0] = Resources.Load<AudioMixer>("Sounds/Ambient_Mixer");
         _mixer[1] = Resources.Load<AudioMixer>("Sounds/Effects_Mixer");
         _mixer[2] = Resources.Load<AudioMixer>("Sounds/Music_Mixer");
         _mixer[3] = Resources.Load<AudioMixer>("Sounds/Other_Mixer");
         _sliders = GameObject.FindGameObjectsWithTag("Slider_CSS");
         _changer_buttons = GameObject.FindGameObjectsWithTag("Changer_Buttons").OrderBy(go => go.name).ToArray();
         _ReMappers = GameObject.FindGameObjectsWithTag("ReMappers").OrderBy(go => go.name).ToArray();
         _sound_sliders = GameObject.FindGameObjectsWithTag("Slider").OrderBy(go => go.name).ToArray();
         _buttons = GameObject.FindGameObjectsWithTag("Main_Buttons");
         _texts = GameObject.FindGameObjectsWithTag("Main_Texts");
         _graphicstext = GameObject.Find("Graphics_Result").GetComponent<TextMeshProUGUI>();
         _vsynctext = GameObject.Find("Vsync_Result").GetComponent<TextMeshProUGUI>();
         _screentext = GameObject.Find("Screen_Result").GetComponent<TextMeshProUGUI>();
         _AA_result = GameObject.Find("AA_Result").GetComponent<TextMeshProUGUI>();
         _AA_sub_result = GameObject.Find("AA_Sub_Result").GetComponent<TextMeshProUGUI>();
         _camera = GameObject.Find("Main Camera").gameObject.GetComponent<HDAdditionalCameraData>();
         _mouse_slider = GameObject.Find("Mouse_Slider").gameObject.GetComponent<Slider>();
         _mouse_slider.value = Universal_Properties._mouse_speed;
       
         foreach (GameObject r in _buttons )
         {
             Image b = r.GetComponent<Image>();
             b.sprite = null;
             b.raycastTarget = Universal_Properties._raycasttarget;
             b.color = new Color32(188, 188, 188, 255);
         }
         foreach (GameObject r in _texts)
         {
             TextMeshProUGUI b = r.GetComponent<TextMeshProUGUI>();
             b.color = Color.white;
             b.alignment = TextAlignmentOptions.Center;
             b.fontSize = 23;
         }
         foreach (GameObject r in _sliders)
         {
             Image b = r.GetComponent<Image>();
             b.sprite = null;
         }
         switch (Universal_Properties._camera_AA)
         {
             case HDAdditionalCameraData.AntialiasingMode.None:
                 {
                     _AA_result.text = _AA_buttonslist[0].GetComponentInChildren<TextMeshProUGUI>().text;
                     _camera.antialiasing = HDAdditionalCameraData.AntialiasingMode.None;
                     break;
                 }
             case HDAdditionalCameraData.AntialiasingMode.FastApproximateAntialiasing:
                 {
                     _AA_result.text = _AA_buttonslist[1].GetComponentInChildren<TextMeshProUGUI>().text;
                     _camera.antialiasing = HDAdditionalCameraData.AntialiasingMode.FastApproximateAntialiasing;
                     break;
                 }
             case HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing:
                 {
                     _AA_result.text = _AA_buttonslist[2].GetComponentInChildren<TextMeshProUGUI>().text;
                     _camera.antialiasing = HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing;
 
                     switch (Universal_Properties._TAA_Quality)
                     {
                         case HDAdditionalCameraData.TAAQualityLevel.Low:
                             {
                                 _AA_sub_result.text = _AA_subbuttonslist[0].GetComponentInChildren<TextMeshProUGUI>().text;
                                 _camera.antialiasing = (HDAdditionalCameraData.AntialiasingMode)HDAdditionalCameraData.TAAQualityLevel.Low;
                                 break;
                             }
                         case HDAdditionalCameraData.TAAQualityLevel.Medium:
                             {
                                 _AA_sub_result.text = _AA_subbuttonslist[1].GetComponentInChildren<TextMeshProUGUI>().text;
                                 _camera.antialiasing = (HDAdditionalCameraData.AntialiasingMode)HDAdditionalCameraData.TAAQualityLevel.Medium;
                                 break;
                             }
                         case HDAdditionalCameraData.TAAQualityLevel.High:
                             {
                                 _AA_sub_result.text = _AA_subbuttonslist[2].GetComponentInChildren<TextMeshProUGUI>().text;
                                 _camera.antialiasing = (HDAdditionalCameraData.AntialiasingMode)HDAdditionalCameraData.TAAQualityLevel.High;
                                 break;
                             }
                     }
                     break;
                 }
             case HDAdditionalCameraData.AntialiasingMode.SubpixelMorphologicalAntiAliasing:
                 {
                     _AA_result.text = _AA_buttonslist[3].GetComponentInChildren<TextMeshProUGUI>().text;
                     _camera.antialiasing = HDAdditionalCameraData.AntialiasingMode.SubpixelMorphologicalAntiAliasing;
 
                     switch (Universal_Properties._SMAA_Quality)
                     {
 
                         case HDAdditionalCameraData.SMAAQualityLevel.Low:
                             {
                                 _AA_sub_result.text = _AA_subbuttonslist[0].GetComponentInChildren<TextMeshProUGUI>().text;
                                 _camera.antialiasing = (HDAdditionalCameraData.AntialiasingMode)HDAdditionalCameraData.SMAAQualityLevel.Low;
                                 break;
                             }
                         case HDAdditionalCameraData.SMAAQualityLevel.Medium:
                             {
                                 _AA_sub_result.text = _AA_subbuttonslist[1].GetComponentInChildren<TextMeshProUGUI>().text;
                                 _camera.antialiasing = (HDAdditionalCameraData.AntialiasingMode)HDAdditionalCameraData.SMAAQualityLevel.Medium;
                                 break;
                             }
                         case HDAdditionalCameraData.SMAAQualityLevel.High:
                             {
                                 _AA_sub_result.text = _AA_subbuttonslist[2].GetComponentInChildren<TextMeshProUGUI>().text;
                                 _camera.antialiasing = (HDAdditionalCameraData.AntialiasingMode)HDAdditionalCameraData.SMAAQualityLevel.High;
                                 break;
                             }
                     }
                     break;
                 }
         }
         switch(Universal_Properties._quality_level)
         {
             case 0:
                 {
                     _graphicstext.text = _graphicsbuttonslist[0].GetComponentInChildren<TextMeshProUGUI>().text;
                     break;
                 }
             case 1:
                 {
                     _graphicstext.text = _graphicsbuttonslist[1].GetComponentInChildren<TextMeshProUGUI>().text;
                     break;
                 }
             case 2:
                 {
                     _graphicstext.text = _graphicsbuttonslist[2].GetComponentInChildren<TextMeshProUGUI>().text;
                     break;
                 }
         }
         switch(Universal_Properties._vsync_lvl)
         {
             case 0:
                 {
                     _vsynctext.text = _vsyncbuttonslist[0].gameObject.GetComponentInChildren<TextMeshProUGUI>().text;
                     break;
                 }
             case 1:
                 {
                     _vsynctext.text = _vsyncbuttonslist[1].gameObject.GetComponentInChildren<TextMeshProUGUI>().text;
                     break;
                 }
             case 2:
                 {
                     _vsynctext.text = _vsyncbuttonslist[2].gameObject.GetComponentInChildren<TextMeshProUGUI>().text;
                     break;
                 }
         }
         
         for (int i = 0; i < _sound_sliders.Length; i++)
         {
             _sound_sliders[i].gameObject.GetComponent<Slider>().onValueChanged.AddListener(delegate { SetVolume(); });
         }
         for (int i = 0; i < _changer_buttons.Length; i++)
         {
             _changer_buttons[i].gameObject.GetComponent<Button>().onClick.AddListener(delegate { ReMapper(); });
             Image b = _changer_buttons[i].GetComponent<Image>();
             b.sprite = null;
             b.raycastTarget = Universal_Properties._raycasttarget;
             b.color = new Color32(188, 188, 188, 255);
         }
         for (int i = 0; i < _ReMappers.Length; i++)
         {
 
         }
 
         #region Scrrencheck
         if (Screen.fullScreen)
         {
             ScreenModeChecker(true);
         }
         else
         {
             ScreenModeChecker(false);
         }
         #endregion
 
         StartCoroutine(Shutters());
 
         #region Resolution listing
         _resolutions = Screen.resolutions;
         _res_dropdown.ClearOptions();
         List<string> options = new List<string>();
         int currenResolutionIndex = 0;
         for (int i = 0; i < _resolutions.Length; i++)
         {
             if (_resolutions[i].refreshRate > 59)
             {
                 string option = _resolutions[i].width + " x " + _resolutions[i].height + " " + _resolutions[i].refreshRate + " Hz";
                 options.Add(option);
             }
 
             if (_resolutions[i].width == Screen.currentResolution.width && _resolutions[i].height == Screen.currentResolution.height)
             {
                 currenResolutionIndex = i;
             }
         }
         _res_dropdown.AddOptions(options);
         _res_dropdown.value = currenResolutionIndex;
         _res_dropdown.RefreshShownValue();
         #endregion  //üstünde durulacak
     }
 
     private void ReMapper()
     {
         
     }
 
     internal static void teller(GameObject obj)
     {
         for (int i = 0; i < _sound_sliders.Length; i++)
         {
             if (_sound_sliders[i] == obj)
             {
                 _sliderIndex = i;
             }
         }
     }
 
     internal static void ScreenModeChecker(bool chk)
     {
         if (chk == true)
             _screentext.text = Universal_Properties._fullscreen;
         else
             _screentext.text = Universal_Properties._windowed;
     }
 
     public void AA_changer()
     {
         switch (EventSystem.current.currentSelectedGameObject.name)
         {
             case "None":
                 {
                     _camera.antialiasing = HDAdditionalCameraData.AntialiasingMode.None;
                     break;
                 }
             case "Fxaa":
                 {
                     _camera.antialiasing = HDAdditionalCameraData.AntialiasingMode.FastApproximateAntialiasing;
                     break;
                 }
             case "Taa":
                 {
                     _camera.antialiasing = HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing;
                     break;
                 }
             case "Smaa":
                 {
                     _camera.antialiasing =  HDAdditionalCameraData.AntialiasingMode.SubpixelMorphologicalAntiAliasing;
                     break;
                 }
         }
         _AA_result.text = EventSystem.current.currentSelectedGameObject.GetComponentInChildren<TextMeshProUGUI>().text;
         Universal_Properties._camera_AA = _camera.antialiasing;
     }
 
     public void Sub_AA_changer()
     {
        if(Universal_Properties._camera_AA == HDAdditionalCameraData.AntialiasingMode.SubpixelMorphologicalAntiAliasing)
         {
             switch (EventSystem.current.currentSelectedGameObject.name)
             {
                 case "AA_High":
                     {
                         Universal_Properties._SMAA_Quality = HDAdditionalCameraData.SMAAQualityLevel.High;
                         break;
                     }
                 case "AA_Medium":
                     {
                         Universal_Properties._SMAA_Quality = HDAdditionalCameraData.SMAAQualityLevel.Medium;
                         break;
                     }
                 case "AA_Low":
                     {
                         Universal_Properties._SMAA_Quality = HDAdditionalCameraData.SMAAQualityLevel.Low;
                         break;
                     }
             }
             _AA_sub_result.text = EventSystem.current.currentSelectedGameObject.GetComponentInChildren<TextMeshProUGUI>().text;
             _camera.SMAAQuality = Universal_Properties._SMAA_Quality;
         }
        else if (Universal_Properties._camera_AA == HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing)
         {
             switch (EventSystem.current.currentSelectedGameObject.name)
             {
 
                 case "AA_High":
                     {
                         Universal_Properties._TAA_Quality = HDAdditionalCameraData.TAAQualityLevel.High;
                         break;
                     }
                 case "AA_Medium":
                     {
                         Universal_Properties._TAA_Quality = HDAdditionalCameraData.TAAQualityLevel.Medium;
                         break;
                     }
                 case "AA_Low":
                     {
                         Universal_Properties._TAA_Quality = HDAdditionalCameraData.TAAQualityLevel.Low;
                         break;
                     }
             }
             _AA_sub_result.text = EventSystem.current.currentSelectedGameObject.GetComponentInChildren<TextMeshProUGUI>().text;
             _camera.TAAQuality = Universal_Properties._TAA_Quality;
         }
     }
 
     public void vsyncchanger()
     {
         switch (EventSystem.current.currentSelectedGameObject.name)
         {
             case "60fps":
                 {
                     QualitySettings.vSyncCount = (int)vsync_lvl.Highfps;
                     break;
                 }
             case "30fps":
                 {
                     QualitySettings.vSyncCount = (int)vsync_lvl.Lowfps;
                     break;
                 }
             case "No_Limit":
                 {
                     QualitySettings.vSyncCount = (int)vsync_lvl.NoLimit;
                     break;
                 }
         }
         _vsynctext.text = EventSystem.current.currentSelectedGameObject.GetComponentInChildren<TextMeshProUGUI>().text;
         Universal_Properties._vsync_lvl = QualitySettings.vSyncCount;
     }
 
     public void graphicspresent()
     {
        switch(EventSystem.current.currentSelectedGameObject.name)
         {
             case "High":
                 {
                     QualitySettings.SetQualityLevel((int)present_lvl.High, true);
                     break;
                 }
             case "Medium":
                 {
                     QualitySettings.SetQualityLevel((int)present_lvl.Medium, true);
                     break;
                 }
             case "Low":
                 {
                     QualitySettings.SetQualityLevel((int)present_lvl.Low, true);
                     break;
                 }
         }
         Universal_Properties._quality_level = QualitySettings.GetQualityLevel();
         _graphicstext.text = EventSystem.current.currentSelectedGameObject.GetComponentInChildren<TextMeshProUGUI>().text;
     }
 
     public void Screenmode_changer()
     {
         if(Screen.fullScreenMode == FullScreenMode.FullScreenWindow)
         {
             Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, FullScreenMode.Windowed); //Çözünürlükler ayarlanacak
                 _screentext.text = Universal_Properties._windowed;
         }
         else
         {
             Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, FullScreenMode.FullScreenWindow);
                 _screentext.text = Universal_Properties._fullscreen;
         }
     }
 
     public void resolution(int Index)
     {
         Debug.Log(Index);
 
         Resolution resolution = _resolutions[Index];
         if (Screen.fullScreenMode == FullScreenMode.FullScreenWindow)
         { Screen.SetResolution(resolution.width, resolution.height, FullScreenMode.FullScreenWindow); }
         else
         { Screen.SetResolution(resolution.width, resolution.height, FullScreenMode.Windowed); }
     } //üstünde durulacak
 
     public void SetVolume()
     {
         _mixer[_sliderIndex].SetFloat(Universal_Properties._fake_enums[_sliderIndex], Mathf.Log10(_sound_sliders[_sliderIndex].gameObject.GetComponent<Slider>().value) * Universal_Properties._volume_percentage);
     }
 
     IEnumerator Shutters()
     {
         yield return null;
         foreach (GameObject r in _shutters)
         {
             r.SetActive(false);
         }
     }
 }
 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
1

Answer by dorusoftware · Apr 16, 2021 at 01:22 AM

not sure what is the problem in your case but turns out using Resources folder in unity is getting deprecated and you should use instead this method descrived here

https://docs.unity3d.com/Packages/com.unity.addressables@1.17/manual/index.html

better leave those resouces folder behind and learn this new method that appears to be better

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wolfgangmami · Apr 16, 2021 at 03:09 AM 0
Share

Looks horrible to learn and practically use. I'll learn when time comes. Somehow my coding causing the problem, I don't know how but I'll find out.

avatar image dorusoftware wolfgangmami · Apr 17, 2021 at 09:24 AM 0
Share

you can check if the folder you have named is actually called Resources with capital R, sound supid but maybe this is the issue.

and maybe this new system I've linked messed up soemthing in your project, maybe is ON by default and broke the automatic packing of Resources folders

avatar image wolfgangmami dorusoftware · Apr 17, 2021 at 10:01 AM 0
Share

I found something while digging and debugging. Firstly, this one sometimes appearing the console. I don't $$anonymous$$d it, because it is happening sometimes ( UnityEngine.Rendering.DebugManager.UpdateActions () (at Library/PackageCache/com.unity.render-pipelines.core@10.4.0/Runtime/Debugging/DebugManager.Actions.cs:241) ). After that I looked up for solution in this site link text After the reimporting the assets. I found the real problem. That unity, only realized after the reimport. Something like this: get_isEditor (get_path if remember correctly) is not allowed to be called from a MonoBehaviour constructor" Error. Maybe I did a rookie mistake I don't know but I almost got it. I'll post an update later.

Follow this Question

Answers Answers and Comments

129 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Keeping item database 1 Answer

How add file to resources folder? 3 Answers

Are .svn directories included in Resources builds? 1 Answer

Everything on Resources folder goes to the build? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges