public static void AddEnergyComboActionToLibrary(EnergyComboAction a_comboAction) { if (!ActionLibrary.ContainsKey(a_comboAction.GetEnergyComboCode())) { ActionLibrary.Add(a_comboAction.GetEnergyComboCode(), a_comboAction); } }
private void Awake() { if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); foreach (EnergyComboAction eca in ActionsToAdd) { EnergyComboAction comboAction = ScriptableObject.CreateInstance <EnergyComboAction>(); comboAction.CloneEnergyComboValues(eca); EnergyComboActionLibrary.AddEnergyComboActionToLibrary(comboAction); } }
public static int CheckChainForCombo(List <ActionEnergy> a_energyChain, out EnergyComboAction o_comboAction) { List <ActionEnergy> chainCache = new List <ActionEnergy>(a_energyChain); while (chainCache.Count > 0) { if (TryGetEnergyComboAction(chainCache.ToArray(), out o_comboAction)) { return(a_energyChain.Count - chainCache.Count); } else { chainCache.RemoveAt(0); } } o_comboAction = null; return(-1); }
public static bool TryGetEnergyComboAction(ActionEnergy[] a_energyCombo, out EnergyComboAction o_comboAction) { return(ActionLibrary.TryGetValue(a_energyCombo, out o_comboAction)); }