Tanoda
GeneratorCHS.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using System;
10using System.IO;
11using UnityEngine;
13
15
16 public struct __CHS_T__ {
18 return default(__CHS_T__);
19 }
20 public static __CHS_T__ operator *(float a, __CHS_T__ b) {
21 return default(__CHS_T__);
22 }
23 }
24
25 [CreateAssetMenu(menuName = "Generator/CHS", order = 900)]
26 public class GeneratorCHS : GeneratorBase {
27 public const string TEMPLATE_NAME = "__CHS__";
28 public const string TEMPLATE_TYPE = "__CHS_T__";
29 public const string TEMPLATE_NAMESPACE = "Leap.Unity.Animation.Generation";
30 public const string TARGET_NAMESPACE = "Leap.Unity.Animation";
31
32 public TextAsset templateAsset;
34
36
37 public override void Generate() {
38 var template = templateAsset.text;
39
40 foreach (var def in definitions) {
41 File.WriteAllText(Path.Combine(destFolder.Path, def.name + ".cs"),
42 template.Replace(TEMPLATE_NAMESPACE, TARGET_NAMESPACE).
43 Replace(TEMPLATE_NAME, def.name).
44 Replace(TEMPLATE_TYPE, def.type));
45 }
46 }
47
48 [Serializable]
49 public struct Definition {
50 public string name;
51 public string type;
52 }
53 }
54}
A convenient serializable representation of an asset folder. Only useful for editor scripts since ass...
Definition: AssetFolder.cs:26
virtual string Path
Gets or sets the folder path. This path will always be a path relative to the asset folder,...
Definition: AssetFolder.cs:43
static __CHS_T__ operator*(float a, __CHS_T__ b)
Definition: GeneratorCHS.cs:20
static __CHS_T__ operator+(__CHS_T__ a, __CHS_T__ b)
Definition: GeneratorCHS.cs:17