예제 #1
0
        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;
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
 public Converter(ConvertParameter param, Sprite[] sprites, Font fontData)
 {
     this.param    = param;
     this.sprites  = sprites;
     this.fontData = fontData;
 }