using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class AreaFlageIconCtrl : IconBase { RectTransform thisTrans; // Start is called before the first frame update void Awake() { thisTrans = this.GetComponent(); } public override void SetUpdateIconMsg(object msg, string msgType = "") { switch (msgType) { case ""://初始化图标 float d = MapHelper.GetPixelFromSize((float)msg)*2; thisTrans.sizeDelta = new Vector2(d, d); break; case "UpdatePos"://更新位置 thisTrans.anchoredPosition = MapHelper.GetAnchorPostionFromWorld((Vector3)msg); break; default: break; } } }