public Neutrophil Spawn(string poolRef, string entityRef) { if (mEntity) //shouldn't get here { return(null); } if (animator) { mEntity = M8.PoolController.GetPool(poolRef).Spawn <Neutrophil>(entityRef, entityRef, null, point.position, null); mEntity.Follow(point); mIsSpawning = true; animator.Play(takeSpawn); } return(mEntity); }
void OnAnimationFinish(M8.Animator.AnimatorData anim, M8.Animator.AMTakeData take) { if (take.name == takeSpawn) { if (mEntity) { mEntity.Follow(null); } mIsSpawning = false; } else if (take.name == takeLaunch) { //set to launch if (mEntity) { mEntity.Launch(mTarget); } mEntity = null; mTarget = null; } }