public void DeleteFarmObject(int userFacilityID) { FarmRoot instance = FarmRoot.Instance; FarmField field = instance.Field; instance.ClearSettingFarmObject(); Singleton <UserDataMng> .Instance.DeleteUserFacility(userFacilityID); bool flag = false; for (int i = 0; i < this.farmObjects.Count; i++) { if (userFacilityID == this.farmObjects[i].userFacilityID) { flag = (this.farmObjects[i].facilityID == 11); GameObject gameObject = this.farmObjects[i].gameObject; field.SetGridPutFlag(this.farmObjects[i], false); this.farmObjects.Remove(this.farmObjects[i]); UnityEngine.Object.Destroy(gameObject); break; } } if (flag) { FarmRoot.Instance.ResetSetteingFence(); } }
public void CancelMove() { FarmRoot instance = FarmRoot.Instance; FarmField field = instance.Field; this.farmObject.DisplayedInFront(false); this.farmObject.ResetPosition(); field.SetGridPutFlag(this.farmObject, true); this.EndSetting(false); }
public FarmGrid.GridPosition ComplatedSetting() { FarmRoot instance = FarmRoot.Instance; FarmField field = instance.Field; this.farmObject.DisplayedInFront(false); FarmGrid.GridPosition result = field.SetGridPutFlag(this.farmObject, true); if (this.farmObject.facilityID == 11) { FarmRoot.Instance.ResetSetteingFence(); } this.EndSetting(false); return(result); }
public void SetMoveFarmObject(FarmObject farmObject) { FarmRoot instance = FarmRoot.Instance; FarmField field = instance.Field; this.farmObject = farmObject; this.settingMode = FarmObjectSetting.SettingMode.MOVE; this.farmObject.SetSettingMark(field, instance.SettingMark); this.farmObject.SetPlaceable(true); farmObject.BackupPosition(); field.SetGridPutFlag(this.farmObject, false); this.farmObject.DisplayedInFront(true); instance.Input.AddTouchDragEvent(new Func <InputControll, bool>(this.OnDrag)); }