private void OnTouchUp(InputControll inputControll, bool isDraged) { if (!isDraged) { if (this.farmObject.gameObject != inputControll.rayHitColliderObject) { FarmObjectSelect component = base.GetComponent <FarmObjectSelect>(); this.CancelEdit(); component.EnabledTouchedEvent(true); } } else if (this.farmObject.isPlaceable) { FarmRoot instance = FarmRoot.Instance; FarmScenery component2 = base.GetComponent <FarmScenery>(); FarmObjectSelect component3 = base.GetComponent <FarmObjectSelect>(); FarmObjectSetting component4 = base.GetComponent <FarmObjectSetting>(); instance.ResetSettingMark(); this.farmObject.DisplayFloorObject(); component4.ComplatedSetting(); component3.SetSelectObject(this.farmObject.gameObject); this.farmObject = null; component3.EnabledTouchedEvent(true); instance.Input.RemoveTouchEndEvent(new Action <InputControll, bool>(this.OnTouchUp)); if (!component2.IsExistStoreFacility()) { instance.farmUI.EnableEditSaveButton(true); } } }
private bool OnDrag(InputControll inputControll) { if (this.farmObject.gameObject == inputControll.rayHitColliderObject) { FarmObjectSetting component = base.GetComponent <FarmObjectSetting>(); if (null == component.farmObject) { FarmRoot instance = FarmRoot.Instance; if (instance.IsVisitFriendFarm) { return(false); } instance.SetActiveNotTouchObject(false); this.SetFacilityButton(false, instance); component.SetMoveFarmObject(this.farmObject); if (instance.farmMode == FarmRoot.FarmControlMode.EDIT) { instance.farmUI.EnableEditSaveButton(false); } return(true); } } else { this.RemoveTouchDragEventForFriendFarm(); } return(false); }
private void OnTouchUp(InputControll inputControll, bool isDraged) { if (isDraged || inputControll.rayHitObjectType != InputControll.TouchObjectType.CHARA || inputControll.rayHitColliderObject != this.digimon || this.ActionID == FarmDigimonAI.ActionID.TOUCH_ACTION) { return; } base.StartCoroutine(this.TouchAction()); }
private void OnTouchUp(InputControll inputControll, bool isDraged) { if (!this.EnableTouch || isDraged || inputControll.rayHitObjectType != InputControll.TouchObjectType.OTHER || inputControll.rayHitColliderObject != base.gameObject || FarmRoot.Instance.IsVisitFriendFarm) { return; } base.StartCoroutine(this.TouchUp()); }
protected void EnableFarmInput() { FarmRoot instance = FarmRoot.Instance; InputControll input = instance.Input; if (null != input) { input.enabled = true; } }
private void Awake() { this.farmCamera = base.gameObject.GetComponent <Camera>(); this.inputControl = base.gameObject.GetComponent <InputControll>(); this.farmCameraDrawArea = base.GetComponent <FarmCameraDrawArea>(); this.targetOrthographicSize = this.farmCamera.orthographicSize; this.viewRotation = base.transform.localEulerAngles; Vector3 localPosition = base.transform.localPosition; localPosition.y -= this.OFFSET_VIEW_POSITION_Y; base.transform.localPosition = localPosition; this.SetDistanceToGround(); this.viewPosition = base.transform.localPosition + this.distanceToGround; this.UpdateCameraTargetLocator(); this.UpdateCameraLocator(false); this.SetDistanceToGround(); }
private void OnTouchUp(InputControll inputControll, bool isDraged) { if (!isDraged) { if (inputControll.rayHitObjectType == InputControll.TouchObjectType.FACILITY) { if (this.selectUserFacilityID != -1) { GameObject gameObject = this.farmObject.gameObject; if (gameObject == inputControll.rayHitColliderObject) { this.RemoveTouchDragEventForFriendFarm(); base.StartCoroutine(this.OnTouchedSelectFarmObject()); } else { this.AddTouchDragEventForFriendFarm(); this.ResetSelectedFarmObject(); this.SetSelectObject(inputControll.rayHitColliderObject); } } else { this.AddTouchDragEventForFriendFarm(); this.SetSelectObject(inputControll.rayHitColliderObject); } } else { this.RemoveTouchDragEventForFriendFarm(); this.ClearSelectState(); } } else if (this.selectUserFacilityID != -1) { if (this.farmObject.gameObject == inputControll.rayHitColliderObject) { this.CompletedMove(); } this.AddTouchDragEventForFriendFarm(); } }
protected override IEnumerator CreateHomeData() { GUIPlayerStatus.RefreshParams_S(false); ClassSingleton <GUIMonsterIconList> .Instance.RefreshList(MonsterDataMng.Instance().GetMonsterDataList()); yield return(base.StartCoroutine(base.CreateFarm())); FarmRoot farm = FarmRoot.Instance; if (null != farm) { InputControll input = farm.Input; input.EnableControl = false; } base.StartCacheBattle(); base.StartCacheParty(); while (!AssetDataCacheMng.Instance().IsCacheAllReady()) { yield return(null); } yield break; }
public bool OnDrag(InputControll inputControll) { if (this.farmObject.gameObject == inputControll.rayHitColliderObject) { FarmRoot instance = FarmRoot.Instance; FarmField field = instance.Field; if (field.Grid.isSelectedGrid) { FarmField.Field field2 = field.GetField(); int[] gridIndexs = this.farmObject.GetGridIndexs(field2, field.Grid.selectedGridIndex); if (!this.farmObject.IsInvalidGrid(field, gridIndexs)) { this.farmObject.SetPosition(field.gridHorizontal, field.gridVertical, field.Grid.GetPositionGridCenter(field.Grid.selectedGridIndex, false)); this.farmObject.DisplayedInFront(true); bool placeable = false == this.farmObject.IsPutGrid(field2, gridIndexs); this.farmObject.SetPlaceable(placeable); } } return(true); } return(false); }
public static void BackToTOP(string guiName = "UIStartupCaution", float outSec = 0.8f, float inSec = 0.8f) { ServerDateTime.isUpdateServerDateTime = false; GUIMain.self.StopAllCoroutines(); if (null != ClassSingleton <FaceChatNotificationAccessor> .Instance.faceChatNotification) { ClassSingleton <FaceChatNotificationAccessor> .Instance.faceChatNotification.StopGetHistoryIdList(); } ClassSingleton <GUIMonsterIconList> .Instance.PushBackAllMonsterPrefab(); ClassSingleton <MonsterUserDataMng> .Instance.Initialize(); ClassSingleton <GUIMonsterIconList> .Instance.AllDelete(); GUIMain.DestroyAllDialog(null); GUIMain.onFadeBlackLoadScene = null; FarmSceneryCache.ClearCache(); TutorialObserver tutorialObserver = UnityEngine.Object.FindObjectOfType <TutorialObserver>(); if (null != tutorialObserver) { UnityEngine.Object.Destroy(tutorialObserver.gameObject); } TutorialUI tutorialUI = UnityEngine.Object.FindObjectOfType <TutorialUI>(); if (null != tutorialUI) { if ("GUI" == tutorialUI.gameObject.name) { UnityEngine.Object.Destroy(tutorialUI); string[] array = new string[] { "ROOT/Panel", "ROOT/HitIcon", "ROOT/HUD" }; foreach (string name in array) { GameObject gameObject = GameObject.Find(name); if (null != gameObject) { UnityEngine.Object.Destroy(gameObject); } } } else { UnityEngine.Object.Destroy(tutorialUI.gameObject); } } AppCoroutine appCoroutine = UnityEngine.Object.FindObjectOfType <AppCoroutine>(); if (null != appCoroutine) { UnityEngine.Object.Destroy(appCoroutine.gameObject); } GUIMain.BarrierReset(); Singleton <GUIManager> .Instance.UseOutsideTouchControl = false; FarmRoot instance = FarmRoot.Instance; if (null != instance) { InputControll input = instance.Input; if (null != input) { input.enabled = false; } } ClassSingleton <QuestData> .Instance.ClearWorldAreaMList(); FarmCameraControlForCMD.ClearRefCT(); GUICollider.DisableAllCollider("GUIMain"); SoundMng.Instance().StopBGM(0.5f, delegate(int n) { if (GUIMain.gUIScreen != guiName) { Action <int> action = delegate(int x) { GUIFadeControll.ActionRestart(); }; string guiName2 = guiName; Action <int> action_ = action; string aploadName_ = "Empty"; string loadGUIName_ = guiName2; string empty = string.Empty; if (GUIMain.< > f__mg$cache0 == null) { GUIMain.< > f__mg$cache0 = new Action <int>(GUIMain.actCallBackBackToTOP); } GUIFadeControll.SetLoadInfo(action_, aploadName_, loadGUIName_, empty, GUIMain.< > f__mg$cache0, false); GUIFadeControll.SetFadeInfo(outSec, 0f, inSec, 1f); GUIManager.LoadCommonGUI("Effect/FADE_W", GUIMain.self.gameObject); } }); GUIMain.nowBgm = string.Empty; Resources.UnloadUnusedAssets(); }
private bool OnFriendFarmDrag(InputControll inputControll) { return(true); }
void Start() { _inputPlayer = new InputControll(); _currentWeapon = GetComponent <Weapon>(); }