- Build Manager system to allow swapping, saving and loading build setups for characters - Necromancer new channeled ability: Soulfire - Mage new melee ability: Cold Slash - Mage new summon ability: Mirror Image - Added summon ability support to spawn more than one minion per cast
44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class BuildLibrary : MonoBehaviour
|
|
{
|
|
#region Singleton
|
|
private static BuildLibrary _instance;
|
|
|
|
// Public reference to the singleton instance
|
|
public static BuildLibrary Instance
|
|
{
|
|
get
|
|
{
|
|
// If the instance doesn't exist, try to find it in the scene
|
|
if (_instance == null)
|
|
{
|
|
_instance = FindObjectOfType<BuildLibrary>();
|
|
|
|
// If it's still null, create a new GameObject and add the component
|
|
if (_instance == null)
|
|
{
|
|
GameObject singletonObject = new GameObject(typeof(BuildLibrary).Name);
|
|
_instance = singletonObject.AddComponent<BuildLibrary>();
|
|
}
|
|
}
|
|
return _instance;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
public List<ClassBuildLibrary> classBuildLibraries = new List<ClassBuildLibrary>();
|
|
|
|
public List<BaseAbility> GetBaseAbilities(GameTag characterClass)
|
|
{
|
|
for (int i = 0; i < classBuildLibraries.Count; i++)
|
|
{
|
|
if (classBuildLibraries[i].characterClass == characterClass)
|
|
return classBuildLibraries[i].possibleClassAbilities;
|
|
}
|
|
return null;
|
|
}
|
|
}
|