本文整理汇总了C#中UnityEngine.EventSystems.BaseEventData类的典型用法代码示例。如果您正苦于以下问题:C# BaseEventData类的具体用法?C# BaseEventData怎么用?C# BaseEventData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseEventData类属于UnityEngine.EventSystems命名空间,在下文中一共展示了BaseEventData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPointerClick
private void OnPointerClick(BaseEventData data){
//if (PC.hasMainKey && PC.ap > 0) {
if(PC.hasMainKey){
OpenDoor ();
return;
}
}
示例2: OnSubmit
public void OnSubmit(BaseEventData eventData)
{
if (dropdown != null)
{
dropdown.Select(m_Index, true);
}
}
示例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;
}
示例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();
}
示例5: OnSelect
public void OnSelect(BaseEventData eventData)
{
// Debug.Log ("CLIQUEI");
//options.Activate(item, this.transform.position);
//options.transform.SetParent (this.transform);
}
示例6: OnSelect
public override void OnSelect(BaseEventData eventData) {
base.OnSelect(eventData);
this.CorrectCaret();
}
示例7: onItemButtonPressed
public void onItemButtonPressed(BaseEventData data)
{
if (!controlsLocked) {
separator.SetActive (true);
item_menu.SetActive (true);
}
}
示例8: OnPointerEnter
public void OnPointerEnter(BaseEventData eventData)
{
enable = true;
Left.enable = false;
Bot.enable = false;
Right.enable = false;
}
示例9: ButtonClick
public void ButtonClick (GameObject gobh, BaseEventData data)
{
ContentManager.mIns.Push (MainViewType.U3View);
}
示例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;
}
}
示例11: attack4Pressed
public void attack4Pressed(BaseEventData data)
{
eventTriggered = true;
usersChoice = InterSceneData.main.battle_friendly.attacks[3];
eventNo = 3;
itemChosen = false;
}
示例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);
}
}
示例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;
}
示例14: OnSelect
public void OnSelect(BaseEventData data)
{
if (_luaFunc != null)
{
_luaFunc.call("onSelect", data);
}
}
示例15: OnSubmit
public void OnSubmit(BaseEventData eventData)
{
if (highlight) button.OnPointerEnter(new PointerEventData(_system));
button.OnPointerClick(new PointerEventData(_system));
if (highlight) Invoke("RemoveHighlight", highlightDuration);
}