void Generate() { PixelSettings pixelSettings = (PixelSettings)ScriptableObject.CreateInstance <PixelSettings>(); AssetDatabase.CreateAsset(pixelSettings, "Assets/Resources/PixelSettings.asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }
void OnEnable() { PixelSettings pixelSettings = (PixelSettings)Resources.Load("PixelSettings"); pixelsPerUnit = pixelSettings.pixelsPerUnit; unitsPerPixel = 1f / pixelsPerUnit; width = Screen.width; height = Screen.height; }
void Update() { canWillRender = true; canRenderObject = true; PixelSettings pixelSettings = (PixelSettings)Resources.Load("PixelSettings"); pixelsPerUnit = pixelSettings.pixelsPerUnit; width = Screen.width; height = Screen.height; unitsPerPixel = 1f / pixelsPerUnit; }