示例#1
0
        static void Postfix(HomeBuilding __instance)
        {
            if (!Main.enabled)
            {
                return;
            }

            string[] array         = __instance.name.Split(new char[] { ',' });
            int      partId        = int.Parse(array[1]);
            int      placeId       = int.Parse(array[2]);
            int      buildingIndex = int.Parse(array[3]);

            if (BuildingExclusion.GetState(partId, placeId, buildingIndex))
            {
                __instance.placeName.text += "[锁]";
            }
        }
示例#2
0
        public void OnPointerUp(PointerEventData eventData)
        {
            if (!Main.enabled)
            {
                return;
            }

            if (!Original.BuildingNeedsWorker(this.partId, this.placeId, this.buildingIndex))
            {
                return;
            }

            // 1: 右键, 2: 中键
            var button = (PointerEventData.InputButton)(Main.settings.exclusionMouseButton + 1);

            if (eventData.button == button && (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt)))
            {
                BuildingExclusion.Toggle(partId, placeId, buildingIndex);
            }
        }