浏览代码

docs

/main
kgc00 4 年前
当前提交
2db1442c
共有 7 个文件被更改,包括 1089 次插入8 次删除
  1. 11
      UOP1_Project/Assets/Scripts/Input/GameInput.cs
  2. 19
      UOP1_Project/Assets/Scripts/Menu/MenuInput.cs
  3. 11
      UOP1_Project/Assets/Settings/Input/GameInput.inputactions
  4. 1001
      UOP1_Project/Assets/Prefabs/Menu/DebugMenu.prefab
  5. 7
      UOP1_Project/Assets/Prefabs/Menu/DebugMenu.prefab.meta
  6. 48
      UOP1_Project/Assets/Prefabs/Menu/debug menu controls.prefab

11
UOP1_Project/Assets/Scripts/Input/GameInput.cs


""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""b03f649e-d5ec-4fad-8614-6a69620c5345"",
""path"": ""<Mouse>/leftButton"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyboardOrGamepad"",
""action"": ""Confirm"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": ""Gamepad Left Stick"",
""id"": ""abfca31e-4360-48f9-89ac-897570e32b3c"",
""path"": ""2DVector(mode=1)"",

19
UOP1_Project/Assets/Scripts/Menu/MenuInput.cs


using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
using UnityEngine.EventSystems;
public class MenuInput : MonoBehaviour

private void HandleMoveSelection()
{
// _currentSelection will be the start UI element, destination is taken care of by the EventSystem for us
var exitingMouseMode = EventSystem.current.currentSelectedGameObject == _currentSelection;
var mouseIsOverSelectionStart = _mouseSelection == _currentSelection;
if (exitingMouseMode)
if (mouseIsOverSelectionStart)
// fire pointer exit event because we don't want the button to be in the 'highlighted' state
EventSystem.current.SetSelectedGameObject(_currentSelection);
// if mouse has moved from a button to empty space we store its last interactable
// if we receive a move command, we use that stored position to recenter focus before the move is executed
if (EventSystem.current.currentSelectedGameObject == null)
EventSystem.current.SetSelectedGameObject(_mouseSelection);
}

{
EventSystem.current.SetSelectedGameObject(uiElement);
_currentSelection = uiElement;
_mouseSelection = uiElement;
}
public void HandleMouseEnter(GameObject uiElement)

// deselect UI element if mouse moves away from it
_mouseSelection = uiElement;
EventSystem.current.SetSelectedGameObject(null);
}
}

11
UOP1_Project/Assets/Settings/Input/GameInput.inputactions


"isPartOfComposite": false
},
{
"name": "",
"id": "b03f649e-d5ec-4fad-8614-6a69620c5345",
"path": "<Mouse>/leftButton",
"interactions": "",
"processors": "",
"groups": "KeyboardOrGamepad",
"action": "Confirm",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "Gamepad Left Stick",
"id": "abfca31e-4360-48f9-89ac-897570e32b3c",
"path": "2DVector(mode=1)",

1001
UOP1_Project/Assets/Prefabs/Menu/DebugMenu.prefab
文件差异内容过多而无法显示
查看文件

7
UOP1_Project/Assets/Prefabs/Menu/DebugMenu.prefab.meta


fileFormatVersion: 2
guid: 0913fb2fbf6c4cb4aa9d88e5feaece97
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

48
UOP1_Project/Assets/Prefabs/Menu/debug menu controls.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7576039656433302283
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7581178889969359010}
- component: {fileID: 7601654174107061493}
m_Layer: 0
m_Name: debug menu controls
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7581178889969359010
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7576039656433302283}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 269.8174, y: 159.33746, z: 623.1245}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7601654174107061493
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7576039656433302283}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bfb8a0b36800464dab759d2f75a1b6a0, type: 3}
m_Name:
m_EditorClassIdentifier:
_menuPrefab: {fileID: 9071686868156487228, guid: 0913fb2fbf6c4cb4aa9d88e5feaece97,
type: 3}
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
正在加载...
取消
保存