Beispiel #1
0
		public void GetDef (string defID)
		{
			def = Finder.DefDatabase.Get (defID);
			if (def == null) {
				if (defID != "") {
					Debug.Log ("Invalid defID: " + defID + " provided, reverting to default");
				}
				defID = DefaultID ();
				def = Finder.DefDatabase.Get (defID);
				if (def == null) {
					Debug.Log ("Default def Invalid, could not create Entity: " + defID);
					
				}
			}
		}
Beispiel #2
0
			public static void Add (Def def)
			{
				String key = def.Name;
				Def value;
				DefDictionary.TryGetValue (key, out value);
				if (value == null) {
					Debug.Log ("Adding Def " + key);
					DefDictionary.Add (key, def);
				} else {
					Debug.Log ("Def of name " + key + " already exists. Setting to new value.");
					DefDictionary [key] = def;
				}
			}
Beispiel #3
0
			public Graphic Get (string path, Def def, bool skipCreateNew =false)
			{
				object val = null;
				dictionary.TryGetValue (path, out val);
				Graphic value = (Graphic)val;
				if (value == null && !skipCreateNew) {
					value = new Graphic (def.GetAttribute ("TextureID"));
				}
				return value;
			}