/// <summary> /// Creates the prefab to do the animation /// Called from the animation /// </summary> public override void SpawnSkillAddition() { // Create the prefab to animate if (_enemiesHP != null && _enemiesHP.Count > 0 && _enemiesHP[0] != null) { Transform enTrans = _enemiesHP[0].transform; // Create the prefab GameObject curPref = Instantiate(_spawnPref); // Center it on the character curPref.transform.SetParent(enTrans); curPref.transform.localPosition = Vector3.zero; // Get the SpecialAttackSpawn script attached to it and set its Spawner SpecialAttackSpawn specialAttackSpawn = curPref.GetComponent <SpecialAttackSpawn>(); specialAttackSpawn.SetSpawner(_maRef); } // End the skills animation EndSkillAnimation(); }
/// <summary> /// Creates the prefab to do the smite /// Called from the animation /// </summary> public override void SpawnSkillAddition() { try { // Create the prefab to animate _activeSkillAnimObj = Instantiate(_spawnPref); // Center it on the character to attack _activeSkillAnimObj.transform.SetParent(_enemiesHP[0].transform); _activeSkillAnimObj.transform.localPosition = Vector3.zero; // Get the SpecialAttackSpawn script attached to it and set its Spawner SpecialAttackSpawn smiteSpawn = _activeSkillAnimObj.transform.GetChild(0).GetComponent <SpecialAttackSpawn>(); smiteSpawn.SetSpawner(_maRef); } catch { Debug.LogError("Failed to create the SmiteSpawn " + _activeSkillAnimObj.transform.GetChild(0).name); } // Start the end skill animation EndSkillAnimation(); }