private T CreateSpellController <T>(PowerTaskList taskList, string prefabName = null) where T : SpellController { T component; GameObject obj2; if (prefabName == null) { obj2 = new GameObject(); component = obj2.AddComponent <T>(); } else { obj2 = AssetLoader.Get().LoadGameObject(prefabName, true, false); component = obj2.GetComponent <T>(); } obj2.name = string.Format("{0} [taskListId={1}]", typeof(T), taskList.GetId()); return(component); }