devomage
Member
When trying to set MagicItem dynamically, all of the Actions do not work. Here is an example of adding CastActions where 'item' is the Fireball MagicItem on Nolan.
The screenshot shows the Inspector during the Cast. The array is a bit wonky looking...
The screenshot shows the Inspector during the Cast. The array is a bit wonky looking...
C#:
#region CastActions
var castAction = new UCCFocus.Items.Actions.Magic.CastActions.DynamicSpawnProjectile();
castAction.SpellIndex = m_SpellIndex;
castAction.ProjectilePrefab = Resources.Load<GameObject>("Prefabs/Magic/Fireball") as GameObject;
castAction.Speed = projectile.velocity / 64f;
castAction.Initialize(m_Locomotion.gameObject, item, 0);
var actions = new System.Collections.Generic.List<Opsive.UltimateCharacterController.Items.Actions.Magic.CastActions.CastAction>();
actions.Add(castAction);
item.CastActions = actions.ToArray();
#endregion
Attachments
Last edited: