50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using static BaseConf;
|
||
//============================================================
|
||
//支持中文,文件使用UTF-8编码
|
||
//@author #AUTHOR#
|
||
//@create #CREATEDATE#
|
||
//@company #COMPANY#
|
||
//
|
||
//@description:
|
||
//============================================================
|
||
|
||
public class UPosItem : MonoBehaviour
|
||
{
|
||
/// <summary>
|
||
/// 是否被占用
|
||
/// </summary>
|
||
public bool isOccupied = false;
|
||
public int ID;
|
||
|
||
public SpriteRenderer instruct;
|
||
public UPosManger uPosManager;
|
||
|
||
public Conf2 conf2 = new Conf2();
|
||
[ContextMenu("Set")]
|
||
public void SetValue()
|
||
{
|
||
instruct = Instantiate(Resources.Load<SpriteRenderer>("Adam/Instruct"), transform);
|
||
//DestroyImmediate(transform.GetChild(0).gameObject);
|
||
instruct.transform.localPosition = new Vector3(0.38f, 0.32f, 0.002f);
|
||
}
|
||
|
||
private void Start()
|
||
{
|
||
ID = int.Parse(gameObject.name);
|
||
uPosManager = transform.parent.GetComponent<UPosManger>();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 设置颜色
|
||
/// </summary>
|
||
/// <param name="color"></param>
|
||
public void SetInstructColor(Color color)
|
||
{
|
||
if (instruct != null)
|
||
instruct.color = color;
|
||
}
|
||
}
|