コード例 #1
0
    public bool AnnounceArch(PArchInfo ArchInfo)
    {
        if (ArchInfo == null)
        {
            return(false);
        }
        bool Refresh = false;

        lock (ArchList) {
            if (!ArchList.Exists((string x) => ArchInfo.Name.Equals(x)))
            {
                ArchList.Add(ArchInfo.Name);
                PSystem.UserManager.ArchPoint += ArchInfo.ArchPoint;
                PSystem.UserManager.Write();
                Refresh = true;
            }
        }
        if (Refresh)
        {
            PThread.Async(() => Write());
        }
        return(Refresh);
    }
コード例 #2
0
 public PArchButtonUI Initialize(Transform Prototype, int _Index, int LineCapacity, PArchInfo _ArchInfo)
 {
     Index    = _Index;
     ArchInfo = _ArchInfo;
     UIBackgroundImage.GetComponentInChildren <Text>().text = ArchInfo.Name;
     UIBackgroundImage.localScale    = new Vector3(1, 1, 1);
     UIBackgroundImage.localPosition = new Vector3(70.0f * (Index % LineCapacity) + Prototype.localPosition.x, -70.0f * (Index / LineCapacity) + Prototype.localPosition.y, 0.0f);
     ArchButton.onClick.AddListener(() => {
         PUIManager.GetUI <PArchUI>().ArchInfoInputField.text = ArchInfo.Name + "\n" + ArchInfo.Info;
     });
     UIBackgroundImage.gameObject.SetActive(true);
     return(this);
 }