Game Development Reference
In-Depth Information
GetComponentInChildren<ParticleSystem>();
if (bloodsplatterParticles == null)
{
Debug.LogError("No Particle System Found");
}
enemyAI = GetComponent<Animator>();
if (enemyAI == null)
{
Debug.LogError("No AI System Found");
}
}
Finally, we will add the following function that will cause the particle system to play (and
also clear the selected enemy from BattleManager ):
void ShowBloodSplatter()
{
bloodsplatterParticles.Play();
ClearSelection();
if (battleManager != null)
{
battleManager.ClearSelectedEnemy();
}
else
{
Debug.LogError("No BattleManager");
}
}
With these in place, we return to the Animation view, right-click on 0:00 in the dark gray
bar of the timeline, and select Add Animation Event , as shown in the following screen-
shot:
Search WWH ::




Custom Search