UnityEngine.Resources.Load C# (CSharp) Method

Load() public static method

public static Load ( string path ) : System.Object
path string
return System.Object
		public static System.Object Load(string path){}
		public static System.Object Load(string path, Type systemTypeInstance){}

Same methods

Resources::Load ( string path, Type systemTypeInstance ) : System.Object

Usage Example

コード例 #1
0
ファイル: ProgressBar.cs プロジェクト: lwx1010/2D_XProject
        public static ProgressBar Show(string bgPath, string fgPath, Action onFinished = null, Image.FillMethod fillMethod = Image.FillMethod.Horizontal, bool leftFill = true)
        {
            if (barGo != null)
            {
                GameObject.DestroyImmediate(barGo);
            }

            barGo          = null;
            curProgressBar = null;
            var tempGo = Instantiate(ResourceManager.LoadGameObjectAssets(PrefabResourceName));

            barGo = tempGo;
            GameObject.DontDestroyOnLoad(barGo);
            curProgressBar          = tempGo.GetComponent <ProgressBar>();
            curProgressBar.onFinish = onFinished;

            curProgressBar.progressBg.sprite = UR.Load <Sprite>(bgPath) as Sprite;
            curProgressBar.progressBg.SetNativeSize();
            curProgressBar.progress.sprite = UR.Load <Sprite>(fgPath) as Sprite;
            curProgressBar.progress.SetNativeSize();

            curProgressBar.progress.type       = Image.Type.Filled;
            curProgressBar.progress.fillMethod = fillMethod;
            curProgressBar.progress.fillOrigin = leftFill ? 0 : 1;
            curProgressBar.progress.fillAmount = 0;
            return(curProgressBar);
        }
All Usage Examples Of UnityEngine.Resources::Load