Exemple #1
0
    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;
    }
Exemple #2
0
    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);
    }
Exemple #3
0
    void DeletePrefab()
    {
        prefab = new AbilityPrefab (editingDisplay);

        if (prefab.Load ())
            prefab.Delete ();
    }
Exemple #4
0
 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);
 }