unityzgy/.svn/pristine/1e/1e5a5e2301ea6db7f6b0851a8ddab3caaaeeb5c2.svn-base
ayuan9957 bf12e02276 feat: 多语言本地化系统 - 支持中/英/法/俄实时切换
- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg)
- LoginPanel: InputField placeholder本地化、字体颜色保持
- HistoryPanel: 用时数据本地化、placeholder本地化
- RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建)
- AppraiseWindowBase: 评价等级本地化、操作消息重建
- EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized
- StudentOperateRecorder: 新增InjectOperateMsgLocalized方法
- LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选
- 字体切换时保留颜色和verticalOverflow
2026-07-16 10:05:59 +08:00

125 lines
3.0 KiB
Plaintext

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GOEventSystem;
//一区九厂标记旗帜
public class AreaFlageCtrl : MonoBehaviour,IPicked,IBindIcon
{
public Text3DCtrl [] text3DCtrl;
private bool canPick;
private StudentButtonIcon buttonIcon;
private string areaName;
private IconBase thisIcon;
bool firstSet = true;
float radius = 100;//厂区半径
private void Start()
{
canPick = true;//默认物体能被捡起
}
public string AreaName
{
get
{
return areaName;
}
}
public bool CanPickDown()
{
return true;
}
//改变当前物体是否能够被捡起
public void ChangePicked(bool can)
{
canPick = can;
}
//不一定所有的时候都能捡起
public bool CanPickUpByRay()
{
return canPick;
}
public void InitFlage(StudentButtonIcon studentButtonIcon)
{
if (buttonIcon&&buttonIcon != studentButtonIcon)//未完成放置时 又发起了新的生成指令 不做任何处理
{
//buttonIcon.SetInteractable(true);
return;
}
buttonIcon = studentButtonIcon;
buttonIcon.SetInteractable(false);
for (int i = 0; i < text3DCtrl.Length; i++)
{
text3DCtrl[i].SetName(studentButtonIcon.text_IconName.text);
}
areaName = studentButtonIcon.text_IconName.text;
}
//放置在地上
public void PickDown()
{
GameObjectManager.Instance.AddPlannedArea(this);//添加安置记录
if (firstSet)//首次放置在地上
{
firstSet = false;
EventCenter.Instance.EventTrigger<IBindIcon>("CreatAreaFlageIcon", this);//发起创建UI指令
if (GroupLearnHelper.isGroup)//分组训练时只有组长可以操作
{
Debug.Log("发送厂区生成指令和位置");
}
}
thisIcon?.SetUpdateIconMsg(this.transform.position, "UpdatePos");//更新UI位置
}
//捡起
public void PickUp()
{
GameObjectManager.Instance.RemoveArea(this);//移除安置记录
}
private void OnDestroy()
{
buttonIcon?.SetInteractable(true);
GameObjectManager.Instance.RemoveArea(this);
if (thisIcon)
Destroy(thisIcon.gameObject);//删除对应的UI
}
//中途放弃拾取 则自动删除该物体
public void StopPick()
{
Destroy(this.gameObject);
if (GroupLearnHelper.isGroup)//分组训练时只有组长可以操作
{
Debug.Log("发送厂区删除指令");
}
}
//任意情况下都能中止
public bool CanStopPick()
{
return true;
}
public GameObject GetGameObject()
{
return this.gameObject;
}
//绑定UI 根据物体初始化UI
public void BindIcon(IconBase icon)
{
thisIcon = icon;
icon.SetName(areaName);
icon.SetUpdateIconMsg(radius);
}
}