예제 #1
0
파일: Acivment.cs 프로젝트: daivers/unity3d
	public void AddDependency(Acivment dependendency)
	{
		dependencies.Add (dependendency);
	}
예제 #2
0
	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
			}
		}
	}