2024-10-23 17:55:55 +08:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using Unity.VisualScripting;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class ItemObj : MonoBehaviour
|
|
|
|
{
|
|
|
|
public ItemSize itemSize => size;
|
2024-10-24 16:54:32 +08:00
|
|
|
public GridType type = GridType.wait;
|
2024-10-29 15:22:32 +08:00
|
|
|
public int ID => id;
|
|
|
|
[SerializeField] private int id = 0;
|
|
|
|
[SerializeField] private int maxLevel = 1;
|
|
|
|
public int Level => level;
|
|
|
|
[SerializeField] private int level = 0;
|
2024-10-23 17:55:55 +08:00
|
|
|
[SerializeField] private ItemSize size;
|
|
|
|
|
|
|
|
[SerializeField] public List<Grid> _grids;
|
|
|
|
public Grid startGrid;
|
|
|
|
public Vector3 dev;
|
2024-10-29 15:22:32 +08:00
|
|
|
public Vector3 mouseDev;
|
2024-10-23 17:55:55 +08:00
|
|
|
|
|
|
|
public void SetOccGrid(List<Grid> _list)
|
|
|
|
{
|
|
|
|
_grids = _list;
|
|
|
|
}
|
2024-10-29 15:22:32 +08:00
|
|
|
|
|
|
|
public bool LevelUp()
|
|
|
|
{
|
|
|
|
if (level + 1 <= maxLevel) return false;
|
|
|
|
level++;
|
|
|
|
return true;
|
|
|
|
}
|
2024-10-23 17:55:55 +08:00
|
|
|
// Start is called before the first frame update
|
|
|
|
void Start()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[Serializable]
|
|
|
|
public class ItemSize
|
|
|
|
{
|
|
|
|
public int x = 1;
|
|
|
|
public int y = 1;
|
|
|
|
}
|