static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { foreach (string asset in importedAssets) { if (!filePath.Equals(asset)) { continue; } ghost data = (ghost)AssetDatabase.LoadAssetAtPath(assetFilePath, typeof(ghost)); if (data == null) { data = ScriptableObject.CreateInstance <ghost> (); data.SheetName = filePath; data.WorksheetName = sheetName; AssetDatabase.CreateAsset((ScriptableObject)data, assetFilePath); //data.hideFlags = HideFlags.NotEditable; } //data.dataArray = new ExcelQuery(filePath, sheetName).Deserialize<ghostData>().ToArray(); //ScriptableObject obj = AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ScriptableObject)) as ScriptableObject; //EditorUtility.SetDirty (obj); ExcelQuery query = new ExcelQuery(filePath, sheetName); if (query != null && query.IsValid()) { data.dataArray = query.Deserialize <ghostData>().ToArray(); ScriptableObject obj = AssetDatabase.LoadAssetAtPath(assetFilePath, typeof(ScriptableObject)) as ScriptableObject; EditorUtility.SetDirty(obj); } } }
public Variable(string name, string fullName, ghost.Domain domain, double range, int value = -1) : base(name, fullName, domain, value) { Range = range; }
static List<Variable> MakeTerranUnits( ghost.Domain domain ) { return new List< Variable > { new Variable( "Marine", domain, Race.Terran ), new Variable( "Firebat", domain, Race.Terran ), new Variable( "Ghost", domain, Race.Terran ), new Variable( "Vulture", domain, Race.Terran ), new Variable( "SiegeTank_tankMode", domain, Race.Terran ), new Variable( "SiegeTank_siegeMode", domain, Race.Terran ), new Variable( "Goliath", domain, Race.Terran ), new Variable( "Wraith", domain, Race.Terran ), new Variable( "Battlecruiser", domain, Race.Terran ), new Variable( "Valkyrie", domain, Race.Terran ) }; }
public Variable(string name, string fullName, ghost.Domain domain, int length, int height, int gapTop, int gapRight, int gapBottom, int gapLeft, Race race, int treedepth, int value = -1) : base(name, fullName, domain, value) { Length = length; Height = height; GapTop = gapTop; GapRight = gapRight; GapBottom = gapBottom; GapLeft = gapLeft; Race = race; Treedepth = treedepth; }
static List<Variable> MakeTerranBuildings( ghost.Domain domain ) { return new List< Variable > { new Variable( "A", "Terran_Academy", domain, 3, 2, 0, 3, 7, 8, Race.Terran, 2 ), new Variable( "A", "Terran_Academy", domain, 3, 2, 0, 3, 7, 8, Race.Terran, 2 ), new Variable( "B", "Terran_Barracks", domain, 4, 3, 8, 7, 15, 16, Race.Terran, 1 ), new Variable( "B", "Terran_Barracks", domain, 4, 3, 8, 7, 15, 16, Race.Terran, 1 ), new Variable( "U", "Terran_Bunker", domain, 3, 2, 8, 15, 15, 16, Race.Terran, 2 ), new Variable( "U", "Terran_Bunker", domain, 3, 2, 8, 15, 15, 16, Race.Terran, 2 ), new Variable( "F", "Terran_Factory", domain, 4, 3, 8, 7, 7, 8, Race.Terran, 2 ), new Variable( "F", "Terran_Factory", domain, 4, 3, 8, 7, 7, 8, Race.Terran, 2 ), new Variable( "S", "Terran_Supply_Depot", domain, 3, 2, 10, 9, 5, 10, Race.Terran, 0 ), new Variable( "S", "Terran_Supply_Depot", domain, 3, 2, 10, 9, 5, 10, Race.Terran, 0 ) }; }
public Variable( string name, string fullName, ghost.Domain domain, int value = -1 ) : this(name, fullName, domain, 0, 0, 0, 0, 0, 0, Race.Unknown, 0, value) { }
public Variable( string name, ghost.Domain domain, Race race, int value = 0 ) : base(name, name, domain, value) { Race = race; }
// Start is called before the first frame update void Start() { script = ghost.GetComponent <ghost>(); }