public void AddDependency(Acivment dependendency) { dependencies.Add (dependendency); }
public void CreateAcivment(string parent, string title, int points, int spriteIndex, string[] dependencies = null) { GameObject acivment = (GameObject)Instantiate(acivmentPrefab); Acivment newAcivment = new Acivment(name, points, spriteIndex, acivment); acivments.Add(title, newAcivment); SetAcivmentInfo(parent, acivment, title); if (dependencies != null) { foreach (string acivmentTitle in dependencies) { Acivment dependency = acivments[acivmentTitle]; dependency.Child = title; newAcivment.AddDependency(dependency); //Dependency = Press Space <-- Child = Press W //NewAcivment = Press W --> Press Space } } }