public override void DropAbility() { Instantiate(AbilityPrefab, new Vector3(transform.position.x, transform.position.y - 0.5f, transform.position.z + 2), Quaternion.identity); AnimalAbility spider = (AnimalAbility)Resources.Load(AbilityPath + AnimalAbilityNameEnum.Spider); AbilityPrefab.GetComponent <AbilityDrop>().AbilityName = spider.AbilityFromAnimal; AbilityPrefab.GetComponent <AbilityDrop>().Description = spider.Description; }
public void CreatePrefabObject() { string filePath = "Assets/AbilitySystem/AbilityPrefabs/Scripts"; System.Type type = AssetDatabase.LoadAssetAtPath <MonoScript>(filePath + "/" + name + "Prefab.cs").GetClass(); Debug.Log(type); GameObject go = new GameObject(); go.AddComponent(type); go.name = name + "Prefab"; AbilityPrefab ap = go.GetComponent <AbilityPrefab>(); ap.abilityInfo = this; attachedPrefab = PrefabUtility.SaveAsPrefabAsset(go, "Assets/AbilitySystem/AbilityPrefabs/GameObjects/" + name + "Prefab.prefab").GetComponent <AbilityPrefab>(); PrefabUtility.SaveAsPrefabAsset(go, "Assets/AbilitySystem/AbilityPrefabs/GameObjects/" + name + "Prefab.prefab"); DestroyImmediate(go); }
void DeletePrefab() { prefab = new AbilityPrefab (editingDisplay); if (prefab.Load ()) prefab.Delete (); }
void CreatePrefab() { // Configure the correponding prefab prefab = new AbilityPrefab (editingDisplay); prefab.Save (editingDisplay); }
void CreatePrefab() { // Configure the correponding prefab prefab = new AbilityPrefab (editingDisplay.id, editingDisplay.name); prefab.Save (editingDisplay.icon, "", editingDisplay.activationCost, editingDisplay.activationCostType); }