public void ItemOnGUIDoubleClick(ItemHandleOnGUI obj) { gameObject.SetActive(true); GameCentalPr.Instance.PlayerInputActionManager.ResetClient(this); obj.Clean(); CursorManager.GetInstance().setMouse(); }
private void PauseGame() { Time.timeScale = 0; nav.gameObject.SetActive(true); nav.PauseMenu(); CursorManager.GetInstance().gameObject.SetActive(false); }
public void OnDrop(GameObject go, GameObject draggedObject) { if (CursorManager.GetInstance().GetDraggingDataType() == DrawDataType.SKILL) { DraggignSkill _skill = CursorManager.GetInstance().getDraggingData() as DraggignSkill; if (null == _skill) { return; } int oldItemId = itemId; SHORTCUTITEM oldItemType = itemType; ButtonBarView.GetInstance().SetShortCut(index, SHORTCUTITEM.SKILL, (int)_skill.skillIndex, true); if (_skill.shorCutIndex >= 0) { if (oldItemType == SHORTCUTITEM.SKILL) { ButtonBarView.GetInstance().SetShortCut(_skill.shorCutIndex, SHORTCUTITEM.SKILL, (int)oldItemId, true); } else { ButtonBarView.GetInstance().SetShortCut(_skill.shorCutIndex, SHORTCUTITEM.NONE, (int)oldItemId, true); cdValue = 0; mark.fillAmount = 1f; } } } CursorManager.GetInstance().ClearDragCursor(); }
void Awake() { sceneMap = new SceneMap(); sceneCamera = this.gameObject.AddComponent <SceneCamera>(); clickScene = MouseClickScene.Create(this); CursorManager.GetInstance().SetCursor(CursorType.ctNormal); }
public void OnDrag(GameObject go, Vector2 delta) { DraggignSkill _skill = new DraggignSkill(); _skill.skillIndex = itemId; _skill.shorCutIndex = index; CursorManager.GetInstance().SetDragingCur(icon.atlas, icon.spriteName, DrawDataType.SKILL, _skill); }
void OnMouseExit() { if (animator != null) { animator.SetBool("selected", false); } CursorManager.GetInstance().TriggerNavigationCursorFromOrgan(); isSelected = false; }
void OnMouseEnter() { if (animator != null) { animator.SetBool("selected", true); } CursorManager.GetInstance().TriggerSelectionCursor(); isSelected = true; }
void OnMouseEnter() { if (type == MouseActionType.PickUp) { CursorManager.GetInstance().setHand(); } if (type == MouseActionType.Eney) { CursorManager.GetInstance().setAttack(); } }
public void UpdateCursor() { if (mDraggedItem != null) { CursorManager.GetInstance().SetDragingCur(dragIcon.atlas, mDraggedItem.DragIcon, DrawDataType.ITEM); } else { //UICursor.Clear(); CursorManager.GetInstance().ClearDragCursor(); } }
void Update() { //"Effect/effect_skill_daobin_01_pugong_gmale.res"; CheckClickSceneObject(); if ( SceneLogic.GetInstance() != null && CMDView.GetInstance() != null && !CMDView.GetInstance().IsEditing() ) { if (Input.GetKeyDown(KeyCode.U)) { if (SceneLogic.GetInstance().MainHero.GetCurActionName().CompareTo("ActionDie") == 0) { SceneLogic.GetInstance().MainHero.Net.SendReliveRequest(true); } } else if (Input.GetKeyDown(KeyCode.Alpha0)) { SceneLogic.GetInstance().MainHero.property.CmdAutoAttack = true; } } //鼠标点击或者鼠标帧移动时间间隔到.. if (UICamera.hoveredObject == null) { if (CursorManager.GetInstance().IsDragging()) { if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1)) { CursorManager.GetInstance().ClearDragCursor(); } return; } MouseSceneHandler(); } else { if (DragItem.isDragging) { return; } CursorManager.GetInstance().SetCursor(CursorType.ctNormal); } }
//设置鼠标在场景上移动的效果.. private void SetMoveSceneObject(SceneEntity so) { if (so == moveCursourSceneEntity) { return; } if (moveCursourSceneEntity != null) { moveCursourSceneEntity.DispatchEvent(ControllerCommand.SET_GLOW, false); } moveCursourSceneEntity = null; if (so == null) { CursorManager.GetInstance().SetCursor(CursorType.ctNormal); SetCursorBySkill(); } else { SceneEntity _hero = so as SceneEntity; if (_hero.property.isDeaded) { CursorManager.GetInstance().SetCursor(CursorType.ctNormal); SetCursorBySkill(); return; } moveCursourSceneEntity = so; moveCursourSceneEntity.DispatchEvent(ControllerCommand.SET_GLOW, true); if (moveCursourSceneEntity.HeroType == KHeroObjectType.hotNpc) { CursorManager.GetInstance().SetCursor(CursorType.ctChat); } else if (moveCursourSceneEntity.HeroType == KHeroObjectType.hotMonster) { CursorManager.GetInstance().SetCursor(CursorType.ctAttack); } else if (moveCursourSceneEntity.HeroType == KHeroObjectType.hotPlayer) { CursorManager.GetInstance().SetCursor(CursorType.ctFriend); } } }
//Picke Upable Object. When we double click on the object in the scene. private void OnMouseDown() { if (!clickManager.DoubleClick()) { return; } if (!isInit) { FetchItemInfo(); } //Find Player and Players inventory TargetLE lplayer = FindObjectOfType <TargetLE>(); LEInventory inventory = lplayer.transform.GetComponentInChildren <LEInventory>(); inventory.AddItem(item); transform.parent.parent = inventory.transform; transform.parent.gameObject.SetActive(false); CursorManager.GetInstance().setMouse(); }
private void ResumeGame() { Time.timeScale = 1; nav.gameObject.SetActive(false); CursorManager.GetInstance().gameObject.SetActive(true); }
void Update() { bool mouseButtonUp = Input.GetMouseButtonUp(0); if (mouseButtonUp) { Vector3 mouseWorldPosition = GetMouseWorldPosition(); if (growIconCoroutine != null) { StopCoroutine(growIconCoroutine); } if (mode == Mode.IDLE) { bool tutoAllows = !GameScenario.IS_TUTORIAL || GameScenario.GetInstance().GetCurrentState() >= GameScenario.RUNNING_OUT_OF_BLUE; if (MouseIsOverTheGround() && tutoAllows) { ShowOrganSettlementIcons(mouseWorldPosition); CursorManager.GetInstance().TriggerSelectionMenuCursor(); Play(openMenuClip); mode = Mode.MENU; } } else if (mode == Mode.MENU) { OrganSettlementIcon selectedIcon = GetSelectedIcon(); bool removeMenu = true; if (selectedIcon != null) { if (GameManager.GetInstance().Buy(iconMap[selectedIcon].resourcesType)) { organObjectList.Add(InstantiateOrgan(new Vector3(mouseWorldPosition.x, 1f, mouseWorldPosition.z), iconMap[selectedIcon])); CursorManager.GetInstance().DestroyStaticCursor(); mode = Mode.SETTLEMENT; Play(closeMenuClip); } else { selectedIcon.LaunchCannotBuyAnimation(); removeMenu = false; Play(errorClip); } } else { CursorManager.GetInstance().TriggerNavigationCursorFromSettlementManager(); mode = Mode.IDLE; Play(closeMenuClip); } if (removeMenu) { List <OrganSettlementIcon> iconList = new List <OrganSettlementIcon>(iconMap.Keys); for (int i = 0; i < iconList.Count; i++) { Destroy(iconList[i].gameObject); } iconMap.Clear(); } } else if (mode == Mode.SETTLEMENT) { GameObject lastOrgan = organObjectList[organObjectList.Count - 1]; bool status = lastOrgan.GetComponent <Organ>().CollideWithOtherOrgan; MasterNodeManager masternode = lastOrgan.GetComponent <MasterNodeManager>(); if (masternode != null) { status = status | masternode.GetCollideWithOtherOrgan(); } if (!status) { SetSpriteSortingLayerName(lastOrgan, "Default"); CursorManager.GetInstance().TriggerNavigationCursorFromSettlementManager(); mode = Mode.IDLE; if (GameScenario.IS_TUTORIAL) { GameScenario.GetInstance().ReachState(GameScenario.CLICK_MAP); } ConvertContainer2Children(lastOrgan); } else { Play(errorClip); } } } if (mode == Mode.SETTLEMENT) { Vector3 mouseWorldPosition = GetMouseWorldPosition(); GameObject lastOrganInstantiated = organObjectList[organObjectList.Count - 1]; lastOrganInstantiated.transform.position = new Vector3(mouseWorldPosition.x, 1f, mouseWorldPosition.z); lastOrganInstantiated.transform.eulerAngles = new Vector3(90, 0, 0); bool status = lastOrganInstantiated.GetComponent <Organ>().CollideWithOtherOrgan; MasterNodeManager masternode = lastOrganInstantiated.GetComponent <MasterNodeManager>(); if (masternode != null) { status = status | masternode.GetCollideWithOtherOrgan(); } if (status) { lastOrganInstantiated.GetComponent <Organ>().SetToForbiddenLook(); } else { lastOrganInstantiated.GetComponent <Organ>().RevertLook(); } } }
void OnMouseExit() { CursorManager.GetInstance().setMouse(); }
/// <summary> /// 查询Controller对应的图片 /// </summary> private void FindControllerTexture() { int controllerType = CursorManager.GetInstance().GetControllerType(); Transform contentTran = transform.GetChild(0); int contentChildCount = contentTran.childCount; for (int i = 0; i < contentChildCount; i++) { Transform tmpTran = contentTran.GetChild(i); if (m_Bg == null) { if (tmpTran.name.Equals("Bg")) { m_Bg = tmpTran.GetComponent <RawImage>(); continue; } } if (m_Label == null) { if (tmpTran.name.Equals("Label")) { m_Label = tmpTran.GetComponent <Text>(); continue; } } if (controllerType == 0) { if (controllerObj != null) { controllerObj.SetActive(false); } } else { if (m_lastControlerType != controllerType) /**当前的手柄类型与上一次的不一样,重新查找图**/ { if (controllerObj != null) /**上一个手柄用的图标**/ { controllerObj.SetActive(false); } if (controllerType == 1) { if (tmpTran.name.Equals("Goblin")) { controllerObj = tmpTran.gameObject; } else { tmpTran.gameObject.SetActive(false); } } else if (controllerType == 2) { if (tmpTran.name.Equals("CV")) { controllerObj = tmpTran.gameObject; } else { tmpTran.gameObject.SetActive(false); } } else if (controllerType == 3) { if (tmpTran.name.Equals("Goblin2")) { controllerObj = tmpTran.gameObject; } else { tmpTran.gameObject.SetActive(false); } } } if (controllerObj != null) { controllerObj.SetActive(true); } } } if (m_lastControlerType != controllerType && controllerType != 0) { m_lastControlerType = controllerType; } }
void OnMouseOver() { CursorManager.GetInstance().TriggerSelectionCursor(); }