本文整理汇总了C#中UnityEngine.EventSystems.BaseEventData类的典型用法代码示例。如果您正苦于以下问题:C# BaseEventData类的具体用法?C# BaseEventData怎么用?C# BaseEventData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseEventData类属于UnityEngine.EventSystems命名空间,在下文中一共展示了BaseEventData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnPointerClick
private void OnPointerClick(BaseEventData data){
//if (PC.hasMainKey && PC.ap > 0) {
if(PC.hasMainKey){
OpenDoor ();
return;
}
}
开发者ID:Rhiojin,项目名称:TheMinoMaze,代码行数:7,代码来源:doorBox.cs
示例2: OnSubmit
public void OnSubmit(BaseEventData eventData)
{
if (dropdown != null)
{
dropdown.Select(m_Index, true);
}
}
开发者ID:adamtelfer,项目名称:idlecraft,代码行数:7,代码来源:DropdownTrigger.cs
示例3: OnSelect
// ####################################################################################################################################### Selection
/// <summary>
/// Select
/// </summary>
/// <param name="eventData"></param>
public void OnSelect(BaseEventData eventData)
{
RectTransform frame_rec = highlight_frame.GetComponent<RectTransform>();
RectTransform rec = gameObject.GetComponent<RectTransform>();
frame_rec.position = rec.position;
frame_rec.sizeDelta = rec.sizeDelta;
}
开发者ID:grasmann,项目名称:ProjectSanon,代码行数:13,代码来源:menu_navigation_element.cs
示例4: OnUpdateSelected
public override void OnUpdateSelected(BaseEventData eventData)
{
if (!isFocused)
return;
bool consumedEvent = false;
while (Event.PopEvent(m_ProcessingEvent))
{
if (m_ProcessingEvent.rawType == EventType.KeyDown)
{
if (!IsAllowedCombination(m_ProcessingEvent))
{
OnCharEntered(this, new EventArgs());
continue;
}
consumedEvent = true;
var shouldContinue = KeyPressed(m_ProcessingEvent);
if (shouldContinue == EditState.Finish)
{
DeactivateInputField();
break;
}
}
}
if (consumedEvent)
{
UpdateLabel();
}
eventData.Use();
}
开发者ID:drussilla,项目名称:ConsoleX,代码行数:34,代码来源:ReadOnlyInputField.cs
示例5: OnSelect
public void OnSelect(BaseEventData eventData)
{
// Debug.Log ("CLIQUEI");
//options.Activate(item, this.transform.position);
//options.transform.SetParent (this.transform);
}
开发者ID:roroque,项目名称:BigChallenge,代码行数:7,代码来源:ItemData.cs
示例6: OnSelect
public override void OnSelect(BaseEventData eventData) {
base.OnSelect(eventData);
this.CorrectCaret();
}
开发者ID:Trithilon,项目名称:Unity3d.UI.Windows,代码行数:7,代码来源:InputField.cs
示例7: onItemButtonPressed
public void onItemButtonPressed(BaseEventData data)
{
if (!controlsLocked) {
separator.SetActive (true);
item_menu.SetActive (true);
}
}
开发者ID:stone3311,项目名称:Thomasmon,代码行数:7,代码来源:MenuOverlayHandler.cs
示例8: OnPointerEnter
public void OnPointerEnter(BaseEventData eventData)
{
enable = true;
Left.enable = false;
Bot.enable = false;
Right.enable = false;
}
开发者ID:Thanhvx-dth,项目名称:Tanks,代码行数:7,代码来源:Top.cs
示例9: ButtonClick
public void ButtonClick (GameObject gobh, BaseEventData data)
{
ContentManager.mIns.Push (MainViewType.U3View);
}
开发者ID:learnUnity,项目名称:KU_NET,代码行数:7,代码来源:U2View.cs
示例10: OnClick
public void OnClick(BaseEventData evnt)
{
switch (InteractionMode)
{
case MapInteractionNormal:
InteractionMode=MapInteractionWriting;
UWHUD.instance.CursorIcon=UWHUD.instance.MapQuillWriting;
pos = Vector2.zero;
RectTransform rect = this.GetComponent<RectTransform>();
PointerEventData pntr = (PointerEventData)evnt;
CursorPos=UWHUD.instance.window.CursorPosition.center;//pntr.pressPosition;
RectTransformUtility.ScreenPointToLocalPointInRectangle(rect,pntr.pressPosition,pntr.pressEventCamera, out pos);
pos = pos + new Vector2 (150.0f, -4.0f);
GameObject myObj = (GameObject)Instantiate(Resources.Load("Prefabs/_MapNoteTemplate"));
mapNoteCurrent=myObj.GetComponent<Text>();
mapNoteCurrent.transform.parent=this.transform;
mapNoteCurrent.GetComponent<RectTransform>().anchoredPosition=pos;
myObj.GetComponent<RectTransform>().SetSiblingIndex(4);
MapNoteInput.textComponent= mapNoteCurrent;
MapNoteInput.text="";
MapNoteInput.Select();
break;
case MapInteractionDelete:
InteractionMode=MapInteractionNormal;
UWHUD.instance.CursorIcon=UWHUD.instance.MapQuill;
break;
case MapInteractionWriting:
OnNoteComplete();
break;
}
}
开发者ID:hankmorgan,项目名称:UnderworldExporter,代码行数:33,代码来源:MapInteraction.cs
示例11: attack4Pressed
public void attack4Pressed(BaseEventData data)
{
eventTriggered = true;
usersChoice = InterSceneData.main.battle_friendly.attacks[3];
eventNo = 3;
itemChosen = false;
}
开发者ID:stone3311,项目名称:Thomasmon,代码行数:7,代码来源:BattleHandler.cs
示例12: OnSelectRoomClick
public void OnSelectRoomClick(BaseEventData data)
{
GamedoniaRT gd = GamedoniaRT.SharedInstance ();
//Debug.Log ("Room Name Clicked: " + eventSystem.currentSelectedGameObject.name);
Text roomLabel = eventSystem.currentSelectedGameObject.GetComponent<Text> ();
string roomName = roomLabel.text.Substring (0, roomLabel.text.IndexOf ("("));
ChooseGameUI.selectedRoom = roomName;
ChooseGameUI.spectator = spectatorToggle.isOn;
Room room = gd.roomsManager.GetRoomByName (roomName);
if (room.IsPasswordProtected ()) {
Application.LoadLevel("EnterRoomPasswordGD");
} else {
JoinRoomOperation jrop = new JoinRoomOperation (roomName);
if (spectatorToggle.isOn) {
jrop.JoinAsSpectator ();
}
gd.SendOp (jrop);
}
}
开发者ID:gamedonia,项目名称:RT-simple-movement,代码行数:29,代码来源:ChooseGameUI.cs
示例13: OnDragEndBattleMember
public void OnDragEndBattleMember(BaseEventData bData)
{
PointerEventData pData = bData as PointerEventData;
//Center of sprite is inside Battle Member Panel
if (RectContainsPosition(battleRect, pData.position) &&
GetClickedImageNumber(clickedGameObject.name) == -1 &&
unitManager.GetBattleSquadCount() < unitManager.maxPlayers)
{
if (UnitManager.DEBUG) print("In BM");
//A reserve unit was dragged and battle members count is less than the max (4)
unitManager.getReserves()[clickedGameObject.transform.GetSiblingIndex()].squad = 0;
menuManager.renderData("Squad Panel");
}
else if (RectContainsPosition(reservesRect, pData.position) &&
clickedGameObject.transform.parent.parent.GetSiblingIndex() < unitManager.GetBattleSquadCount())
{
//Center of sprite is inside Reserves Panel
if (UnitManager.DEBUG) print("In Reserves");
unitManager.getBattlingSquad()[clickedGameObject.transform.parent.parent.GetSiblingIndex()].squad = 1;
menuManager.renderData("Squad Panel");
}
//Return sprite to original location
if (UnitManager.DEBUG) print("Return to initPos");
pData.lastPress.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
}
开发者ID:WinstonLiang,项目名称:100-Days,代码行数:27,代码来源:DragScript.cs
示例14: OnSelect
public void OnSelect(BaseEventData data)
{
if (_luaFunc != null)
{
_luaFunc.call("onSelect", data);
}
}
开发者ID:nottvlike,项目名称:OpenWorldGame,代码行数:7,代码来源:LuaOnSelectEvent.cs
示例15: OnSubmit
public void OnSubmit(BaseEventData eventData)
{
if (highlight) button.OnPointerEnter(new PointerEventData(_system));
button.OnPointerClick(new PointerEventData(_system));
if (highlight) Invoke("RemoveHighlight", highlightDuration);
}
开发者ID:illvisation,项目名称:cellVIEW_bdbox,代码行数:7,代码来源:ReturnKeyTriggersButton.cs
示例16: OnDeselect
public virtual void OnDeselect (BaseEventData data)
{
// Only play the sound if the element is interactable. I disable that
// when animations are playing in between menus.
if(gameObject.GetComponent<Selectable>().IsInteractable())
Manager_Audio.PlaySound (transform.root.GetComponent<AudioSource>(), Manager_Audio.instance.sfxMenuMove, true);
}
开发者ID:MMEstrada,项目名称:GoGoGrandmas,代码行数:7,代码来源:EventTrigger.cs
示例17: OnDrag
public void OnDrag(BaseEventData data)
{
Vector3 position = Camera.main.ScreenToWorldPoint((data as PointerEventData).position);
if (m_rotatedObject == null) return;
if(Input.touchCount==2)
{
Vector3 firstTouch=Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position);
Vector3 secondTouch = Camera.main.ScreenToWorldPoint(Input.GetTouch(1).position);
float angle = Vector2.Angle(Vector2.right, secondTouch - firstTouch);
Debug.Log(angle);
position = (secondTouch + firstTouch) / 2;
position.z = 10;
if (secondTouch.y < firstTouch.y)
angle = -angle;
float scale = (firstTouch - secondTouch).magnitude / m_basicRenderSize;
m_rotatedObject.SendMessage("SetAngleOnCreation", angle);
m_rotatedObject.SendMessage("SetScaleOnCreation", scale);
m_rotatedObject.SendMessage("DragOnCretaion", (Vector2)position);
}
else
m_rotatedObject.SendMessage("DragOnCretaion", (Vector2)position);
}
开发者ID:crassus0,项目名称:Goblins,代码行数:25,代码来源:GUIMachine.cs
示例18: OnClick
public void OnClick(BaseEventData evnt)
{
if (Dragging){return;}
PointerEventData pntr = (PointerEventData)evnt;
//Debug.Log (pnt.pointerId);
ClickEvent(pntr.pointerId);
}
开发者ID:hankmorgan,项目名称:UnderworldExporter,代码行数:7,代码来源:SpellEffectsDisplay.cs
示例19: onAttackButtonPressed
public void onAttackButtonPressed(BaseEventData data)
{
if (!controlsLocked) {
separator.SetActive (true);
attack_menu.SetActive (true);
}
}
开发者ID:stone3311,项目名称:Thomasmon,代码行数:7,代码来源:MenuOverlayHandler.cs
示例20: OnUpdateSelected
public override void OnUpdateSelected(BaseEventData eventData)
{
if (!isFocused)
return;
bool consumedEvent = false;
while (Event.PopEvent(m_ProcessingEvent))
{
if (m_ProcessingEvent.rawType == EventType.KeyDown)
{
if (ProcessKeyPress(m_ProcessingEvent))
{
continue;
}
consumedEvent = true;
var shouldContinue = KeyPressed(m_ProcessingEvent);
if (shouldContinue == EditState.Finish)
{
DeactivateInputField();
break;
}
}
}
if (consumedEvent)
UpdateLabel();
eventData.Use();
}
开发者ID:drussilla,项目名称:ConsoleX,代码行数:30,代码来源:CommandPrompt.cs
注:本文中的UnityEngine.EventSystems.BaseEventData类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论