25 lines
627 B
C#
25 lines
627 B
C#
using UnityEngine;
|
|
|
|
public class AddCollider : MonoBehaviour
|
|
{
|
|
public Transform Sphere;
|
|
|
|
public RealWaterSpeedManager SpeedManager;
|
|
|
|
private float native_width = 1920f;
|
|
|
|
private float native_height = 1080f;
|
|
|
|
private void OnGUI()
|
|
{
|
|
float x = (float)Screen.width / native_width;
|
|
float y = (float)Screen.height / native_height;
|
|
GUI.matrix = Matrix4x4.TRS(new Vector3(0f, 0f, 0f), Quaternion.identity, new Vector3(x, y, 1f));
|
|
if (GUI.Button(new Rect(57.6f, 324f, 288f, 43.2f), "Add Sphere"))
|
|
{
|
|
Object.Instantiate(Sphere, new Vector3(22f, 5f, 20f), Quaternion.identity);
|
|
SpeedManager.FindColliders();
|
|
}
|
|
}
|
|
}
|