void Grow() { if (!mSpawnedMucusForm) { //generate a new form Vector2 spawnPos = mucusFormSpawnAt.position; mSpawnedMucusForm = M8.PoolController.SpawnFromGroup <EntityMucusForm>(mucusFormPoolGroup, mucusFormSpawnRef, mucusFormSpawnRef, null, spawnPos, null); } if (mSpawnedMucusForm) { mSpawnedMucusForm.Grow(); //full? if (mSpawnedMucusForm.currentGrowthCount >= mSpawnedMucusForm.stats.growthMaxCount) { if (animator) { animator.Stop(); } if (gatherDisplayRoot) { gatherDisplayRoot.SetActive(false); } } //Debug.Log("growth count: "+mSpawnedMucusForm.currentGrowthCount); } //check if form becomes bigger than us //make our area bigger }
/// <summary> /// Call by mission to start with a spawn, make sure to populate first /// </summary> public void StartSpawn() { //stop current action if (mLaunchReadyRout != null) { StopCoroutine(mLaunchReadyRout); mLaunchReadyRout = null; } if (mRout != null) { StopCoroutine(mRout); } animator.Stop(); //clear out previous spawned ClearSpawned(true); if (mSpawnInfoGen == null) { Debug.LogWarning("No Spawn Info Generator for: " + name); return; } mRout = StartCoroutine(DoSpawn()); }
public void Reset(bool releaseEntity) { if (mEntity) { if (releaseEntity) { mEntity.Release(); } mEntity = null; } mTarget = null; mIsSpawning = false; if (animator) { animator.Stop(); } }
public void Reset() { if (mRout != null) { StopCoroutine(mRout); mRout = null; } if (animator) { animator.Stop(); int lastTakeInd = animator.lastPlayingTakeIndex; if (lastTakeInd != -1) { animator.ResetTake(lastTakeInd); } } mIsDocked = false; spriteRender.sortingOrder = mOrderDefault; }