private void OnEnable() { var path = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this)).Split('/').ToList(); path.RemoveRange(path.Count - 2, 2); parameter = AssetDatabase.LoadAssetAtPath <ConvertParameter>(string.Join("/", path.ToArray()) + "/ConvertParameter.asset"); if (parameter == null) { Debug.LogError("not found convert parameter asset."); } fontData = parameter.defaultFont; }
private void OnEnable() { var path = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this)).Split('/').ToList(); path.RemoveRange(path.Count - 2, 2); parameter = AssetDatabase.LoadAssetAtPath <ConvertParameter>(string.Join("/", path.ToArray()) + "/ConvertParameter.asset"); if (parameter == null) { Debug.LogError("not found convert parameter asset."); } fontData = parameter.defaultFont; GameObject canvasObj = GameObject.Find("Canvas"); if (canvasObj == null) { canvasObj = new GameObject("Canvas"); var canvas = canvasObj.AddComponent <Canvas>(); canvas.renderMode = RenderMode.ScreenSpaceOverlay; } }
public Converter(ConvertParameter param, Sprite[] sprites, Font fontData) { this.param = param; this.sprites = sprites; this.fontData = fontData; }