31 lines
528 B
C#
31 lines
528 B
C#
using UnityEngine;
|
|
|
|
public class WaterRiverSet : MonoBehaviour
|
|
{
|
|
public BoxCollider boxCollider;
|
|
|
|
[Tooltip("siła prądu")]
|
|
public float PowerCurrent = 1f;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
}
|
|
|
|
private void OnDrawGizmos()
|
|
{
|
|
Gizmos.DrawWireCube(base.transform.position, boxCollider.bounds.size);
|
|
}
|
|
|
|
private void OnTriggerStay(Collider other)
|
|
{
|
|
if (other.TryGetComponent<FWaterDisplacement>(out var component))
|
|
{
|
|
component.ForceByWaterCurrent(base.transform.forward, PowerCurrent);
|
|
}
|
|
}
|
|
}
|