protected virtual void GenerateObjects() { if (mono == null) { return; } prototype = mono as IGeneratable; DestroyObjects(); for (int i = 0; i < objectsToSpawn; i++) { IGeneratable obj = (IGeneratable)Instantiate <MonoBehaviour> (prototype.GetScript()); obj.Generate(i); obj.GetTransform().SetParent(this.transform, false); obj.GetTransform().localScale = Vector3.one; } }