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); }
public void Reset(bool releaseEntity) { if (mEntity) { if (releaseEntity) { mEntity.Release(); } mEntity = null; } mTarget = null; mIsSpawning = false; if (animator) { animator.Stop(); } }
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; } }
void Start() { neutScript = parentNeut.GetComponent <Neutrophil>(); }