// --- MonoBehaviour ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------------- // --- Methods ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------- protected override void Setup() { sourceBlobby = GetComponentInChildren <Blobby>(true); killed += OnKilled; Initialize(settings["speed"].f); StartCoroutine(SpawnBlobsCoroutine()); }
// ----------------------------------------------------------------------------------- /// <summary> /// Called from the animation as an event, at the moment the blob must be spawned /// </summary> void AnimationCallback_SpawnBlob() { Blobby newBlobby = Instantiate(sourceBlobby); AddMinion(newBlobby); newBlobby.gameObject.SetActive(true); newBlobby.transform.SetParent(transform.parent, true); newBlobby.transform.position = sourceBlobby.transform.position; newBlobby.transform.localScale = Vector3.one * ScaleBasedOnMaskSize(); newBlobby.SetXYFromLocalPosition(); newBlobby.Run(); spawnFinished = true; }