Exemplo n.º 1
0
    public static void CreateNewSimpleBuildingRules()
    {
        SimpleBuildingRules.BuildingRules asset = ScriptableObject.CreateInstance <SimpleBuildingRules.BuildingRules>();

        AssetDatabase.CreateAsset(asset, "Assets/NewSimpleBuildingRules.asset");
        AssetDatabase.SaveAssets();

        EditorUtility.FocusProjectWindow();

        Selection.activeObject = asset;
    }
 public void Check(BuildingRules against)
 {
     foreach (BuildingRules rule in subRules)
     {
         if (rule == against)
         {
             throw new System.Exception("Recursive building rules not supported!");
         }
         rule.Check(against);
         rule.Check(this);
     }
 }