commit7912604fafAuthor: AsanoRema <asanorema2036@gmail.com> Date: Tue Aug 11 17:22:28 2026 +0300 update .gitignore commitd71b90c8bdAuthor: henjkey <henjkey@gmail.com> Date: Tue Aug 11 18:42:09 2026 +0500 Edited Добавлен таймер, конфиг и публичный метод SpawnItems() CooldownRemaining - оставшееся время до спавна float CooldownSecondsRemaining - оставшееся время до спавна int commit5b888fba95Author: AsanoRema <asanorema2036@gmail.com> Date: Tue Aug 11 10:30:09 2026 +0300 Changed .gitignore commite3d5561fc8Author: henjkey <henjkey@gmail.com> Date: Tue Aug 11 10:47:35 2026 +0500 New Второй спавнер с нормальными настройками и обновленные префабы
55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[CreateAssetMenu(
|
|
fileName = "ItemPipeConfig",
|
|
menuName = "Fort Bo/Pipe Junk/Item Pipe Config")]
|
|
public sealed class ItemPipeConfig : ScriptableObject
|
|
{
|
|
[Serializable]
|
|
public sealed class GuaranteedItem
|
|
{
|
|
public GameObject prefab;
|
|
|
|
[Min(1)]
|
|
public int amount = 1;
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class RandomItem
|
|
{
|
|
public GameObject prefab;
|
|
|
|
[Min(0f)]
|
|
public float weight = 1f;
|
|
}
|
|
|
|
[Header("Timing")]
|
|
[SerializeField, Min(0.05f)] private float spawnInterval = 0.5f;
|
|
[SerializeField, Min(0f)] private float spawnCooldown = 10f;
|
|
|
|
[Header("Instant velocity change")]
|
|
[SerializeField] private Vector3 localVelocityChange = Vector3.forward * 4.5f;
|
|
|
|
[Header("Guaranteed items")]
|
|
[SerializeField] private List<GuaranteedItem> guaranteedItems = new();
|
|
|
|
[Header("Random items")]
|
|
[SerializeField, Min(0)] private int randomItemCount = 5;
|
|
[SerializeField] private List<RandomItem> randomItems = new();
|
|
|
|
[Header("Spawn position randomization")]
|
|
[SerializeField, Min(0f)] private float randomSpawnX = 0.2f;
|
|
[SerializeField, Min(0f)] private float randomSpawnZ = 0.2f;
|
|
|
|
public float SpawnInterval => spawnInterval;
|
|
public float SpawnCooldown => spawnCooldown;
|
|
public Vector3 LocalVelocityChange => localVelocityChange;
|
|
public IReadOnlyList<GuaranteedItem> GuaranteedItems => guaranteedItems;
|
|
public int RandomItemCount => randomItemCount;
|
|
public IReadOnlyList<RandomItem> RandomItems => randomItems;
|
|
public float RandomSpawnX => randomSpawnX;
|
|
public float RandomSpawnZ => randomSpawnZ;
|
|
}
|