using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
///
/// опт
///
public class ZonesEditorController : MonoBehaviour
{
public Dictionary Zones = new Dictionary();
//public class Zone
//{
//}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public Zone CreateZone(uint location_id)
{
var z = new Zone {
id = Convert.ToUInt32(4000000000 + Zones.Count),
location_id = location_id,
name = $"Зона {Zones.Count +1}"
};
AddZone(z);
return z;
}
public void EditZone()
{
}
///
/// добавление зоны
///
///
///
///
///
public void AddZone(Zone z)
{
var zone = Instantiate(Resources.Load("GameObjects/Zone", typeof(GameObject))) as GameObject;
zone.transform.SetParent(transform);
var zoneController = zone.GetComponent();
zoneController.Rename($"Zone_{Zones.Count + 1}", z.name);
if (z != null)
{
zone.transform.position = new Vector3(z.start_height, 1, z.start_width);
zone.transform.localScale = new Vector3(z.end_height, 1, z.end_width);
}
}
public void DeleteZone(uint id)
{
Destroy(Zones[id].go);
Destroy(Zones[id].buttons);
Zones.Remove(id);
}
}