Here is my auto generated resource class which i modify to use the UnityEngine.Texture2D
class instead of System.Drawing.Bitmap
namespace DaiMangou.Properties {
using System;
using UnityEngine;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class GeneralImageResources {
internal static Texture2D ScaleHandle {
get {
object obj = ResourceManager.GetObject("ScaleHandle", resourceCulture);
return ((Texture2D)(obj));
}
}
}
Here is my other class in another script
public class ScaleHandle
{
public Texture2D scaleHandleTexture = DaiMangou.Properties.GeneralImageResources.ScaleHandle;
}
This, however throws an error
"InvalidCastException: Cannot cast from source type to destination type."
How do I pass the ScaleHandle
texture to my scaleHandleTexture
field ?
The Unity Engine does not support the use of System.Drawing so I really cant use Bitmap