public void RemoveProperty(WorldProperty goal) { if (myGoals.ContainsKey(goal.type)) { myGoals.Remove(goal.type); } }
public void AddProperty(WorldProperty goal) { if (!myGoals.ContainsKey(goal.type)) { myGoals.Add(goal.type, goal); } }
public static bool CreateWorldPropertyAsset(WorldProperty property, string fileName) { if (!fileName.EndsWith(".asset")) { fileName += ".asset"; } if (DoesAssetExist(fileName, WorldPropertyPath)) { Debug.LogErrorFormat("Already created asset with name {0}", fileName); return(false); } WorldPropertyScriptable scriptable = ScriptableObject.CreateInstance <WorldPropertyScriptable>(); scriptable.FromRuntimeProperty(property, true); AssetDatabase.CreateAsset(scriptable, string.Format("{0}/{1}", WorldPropertyPath, fileName)); NarrativeDictionary.GetAsset().AddWorldProperty(scriptable); return(true); }
set => SetValue(WorldProperty, value);
// Use this for initialization void Start() { worldProperty = new WorldProperty(); worldProperty.iValue = thirstStart; }
// Use this for initialization void Start() { worldProperty = new WorldProperty(); worldProperty.iValue = hungerStart; }