37 lines
876 B
C#
37 lines
876 B
C#
|
using System.Collections.Generic;
|
|||
|
using Game.Player;
|
|||
|
using Sirenix.OdinInspector;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace Game.Room;
|
|||
|
|
|||
|
public class RoomInfo : MonoBehaviour
|
|||
|
{
|
|||
|
[SerializeField] [ReadOnly] private IRoom _room;
|
|||
|
[SerializeField] [ReadOnly] private Vector2 room_LeftDown;
|
|||
|
[SerializeField] [ReadOnly] private Vector2 room_RightUp;
|
|||
|
|
|||
|
[ShowInInspector]
|
|||
|
private Transform left
|
|||
|
{
|
|||
|
set => this.room_LeftDown = value.position;
|
|||
|
get => null;
|
|||
|
}
|
|||
|
|
|||
|
[ShowInInspector]
|
|||
|
private Transform right
|
|||
|
{
|
|||
|
set => this.room_RightUp = value.position;
|
|||
|
get => null;
|
|||
|
}
|
|||
|
|
|||
|
public Vector2 GetJoinPosition()
|
|||
|
{
|
|||
|
var vector2 = this.room_RightUp - this.room_LeftDown;
|
|||
|
|
|||
|
Vector2 vec = new Vector2(Random.Range(0, vector2.x), Random.Range(0, vector2.y));
|
|||
|
vec += this.room_LeftDown;
|
|||
|
|
|||
|
return vec;
|
|||
|
}
|
|||
|
}
|