38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[System.Serializable]
|
|
public class ParallaxObjectCategoryConfig
|
|
{
|
|
public string categoryName; // 分类名称
|
|
public bool isEnabled = true; // 当前层是否启用
|
|
public GameObject[] objects; // 物体预制体
|
|
public float speed; // 移动速度
|
|
[Tooltip("生成位置,负数即为隐藏位置")]
|
|
public float xSpawnRange; // X轴生成范围
|
|
|
|
[Tooltip("基于距离生成的触发阈值,如果勾选了useIntervalGeneration则无需关注")]
|
|
public float generationThreshold;
|
|
|
|
[Tooltip("是否按时间间隔生成,如果不是那么按照距离生成,不勾选则下方参数无需关注")]
|
|
public bool useIntervalGeneration; // 是否按时间间隔生成
|
|
|
|
[Tooltip("按时间间隔生成的时间间隔")] // 显示时的提示
|
|
public float spawnInterval;
|
|
|
|
[Tooltip("每组生成的物体数量")]
|
|
public int batchSize = 3;
|
|
|
|
[Tooltip("每个物体之间的生成间隔")]
|
|
public float batchInterval = 0.2f;
|
|
|
|
[Tooltip("每组生成后的等待时间")]
|
|
public float delayAfterBatch = 2f;
|
|
|
|
}
|
|
|
|
|
|
|
|
|