예제 #1
0
        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);
        }
예제 #2
0
        public void Reset(bool releaseEntity)
        {
            if (mEntity)
            {
                if (releaseEntity)
                {
                    mEntity.Release();
                }

                mEntity = null;
            }

            mTarget = null;

            mIsSpawning = false;

            if (animator)
            {
                animator.Stop();
            }
        }
예제 #3
0
        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>();
 }