Added fruit spawner

This commit is contained in:
2026-03-30 11:01:45 +01:00
parent b3202a4636
commit c2455dba60
9 changed files with 512 additions and 11 deletions

View File

@@ -0,0 +1,24 @@
using PashaBibko.Pacore.Attributes;
using JetBrains.Annotations;
using UnityEngine;
namespace Fruitomation
{
public class FruitSpawner : MonoBehaviour
{
[Header("References")]
[SerializeField] private Transform FruitSpawnParent;
[SerializeField] private GameObject FruitPrefab;
[UsedImplicitly, InspectorCallable("Spawn Fruit")]
private void SpawnFruit()
{
GameObject go = Instantiate(FruitPrefab, FruitSpawnParent);
Rigidbody2D rb = go.GetComponent<Rigidbody2D>();
Debug.Assert(rb != null, "Could not find Rigidbody2D component on FruitSpawner.");
rb.velocity = Random.insideUnitCircle * 2.5f;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1fc36d0808cf971459d9e430faaeadd9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
{
"name": "Fruitomation",
"rootNamespace": "",
"references": [
"GUID:4d6a1c1727d80284f86640644e0ea451"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c657622e563023e4faa9e16d7d3be835
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: