csharp 来自http://www.reddit.com/r/Unity3D/comments/2xyy53/how_do_you_use_resources_in_your_projects/

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 来自http://www.reddit.com/r/Unity3D/comments/2xyy53/how_do_you_use_resources_in_your_projects/相关的知识,希望对你有一定的参考价值。

[AdvancedInspector, Serializable]
public class WeakReference
{
    [SerializeField]
    private string path;

    [Inspect]
    public UnityEngine.Object Object
    {
        get { return Resources.Load(path); }
#if UNITY_EDITOR
        set 
        {
            if (value == null)
            {
                path = "";
                return;
            }

            string fullPath = AssetDatabase.GetAssetPath(value);
            string[] paths = fullPath.Split('.')[0].Split(new string[] { "/Resources/" }, StringSplitOptions.RemoveEmptyEntries);
            if (paths.Length == 1)
            {
                path = paths[0];
                return;
            }

            path = paths[1];
        }
#endif
    }

    public static implicit operator UnityEngine.Object(WeakReference reference)
    {
        return reference.Object;
    }

    public WeakReference() { }

#if UNITY_EDITOR
    public static implicit operator WeakReference(UnityEngine.Object source)
    {
        return new WeakReference(source);
    }

    public WeakReference(UnityEngine.Object source)
    {
        Object = source;
    }
#endif
}

以上是关于csharp 来自http://www.reddit.com/r/Unity3D/comments/2xyy53/how_do_you_use_resources_in_your_projects/的主要内容,如果未能解决你的问题,请参考以下文章

csharp 来自csvj的getFrameworkVersion在tfvc上

csharp 来自http://www.codemag.com/Article/1312081

csharp 来自http://www.codemag.com/Article/1312081

csharp 来自http://www.codemag.com/Article/1312081

csharp 来自http://www.codemag.com/Article/1312081

csharp HMACSHA256来自http://ideone.com/JdpeL