case3
This commit is contained in:
@@ -90,6 +90,17 @@
|
|||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "7fc1ec66-0a14-412e-af82-a73fe8657d21",
|
||||||
|
"path": "<Gamepad>/leftStick",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Move",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "",
|
"name": "",
|
||||||
"id": "c7332d6a-fb2a-4c41-9ff3-5052e528eb9b",
|
"id": "c7332d6a-fb2a-4c41-9ff3-5052e528eb9b",
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 20d65dd829f7a694e8a108dc9df70d62
|
guid: 3571fff6229007a40b7048af6d454f6a
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
8
Assets/Samples/Input System/1.14.2.meta
Normal file
8
Assets/Samples/Input System/1.14.2.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 43b4bb25656eeac4f8fad57a33fe1506
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bef78653c9f0fd044810c3140d4a8b74
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"displayName": "On-Screen Controls",
|
||||||
|
"description": "Demonstrates a simple setup for an on-screen joystick."
|
||||||
|
}
|
||||||
@@ -0,0 +1,222 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1001 &100100000
|
||||||
|
Prefab:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications: []
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 0}
|
||||||
|
m_RootGameObject: {fileID: 1728513650105062}
|
||||||
|
m_IsPrefabAsset: 1
|
||||||
|
--- !u!1 &1728513650105062
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 224771122883764374}
|
||||||
|
- component: {fileID: 222401134047137570}
|
||||||
|
- component: {fileID: 114826362001716654}
|
||||||
|
- component: {fileID: 114204224268582166}
|
||||||
|
- component: {fileID: 114344768413473294}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Button
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!1 &1977925927173892
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 224750732080817856}
|
||||||
|
- component: {fileID: 222878083001498966}
|
||||||
|
- component: {fileID: 114547973042304788}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Text
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &114204224268582166
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1728513650105062}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Navigation:
|
||||||
|
m_Mode: 3
|
||||||
|
m_SelectOnUp: {fileID: 0}
|
||||||
|
m_SelectOnDown: {fileID: 0}
|
||||||
|
m_SelectOnLeft: {fileID: 0}
|
||||||
|
m_SelectOnRight: {fileID: 0}
|
||||||
|
m_Transition: 1
|
||||||
|
m_Colors:
|
||||||
|
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||||
|
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||||
|
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||||
|
m_ColorMultiplier: 1
|
||||||
|
m_FadeDuration: 0.1
|
||||||
|
m_SpriteState:
|
||||||
|
m_HighlightedSprite: {fileID: 0}
|
||||||
|
m_PressedSprite: {fileID: 0}
|
||||||
|
m_DisabledSprite: {fileID: 0}
|
||||||
|
m_AnimationTriggers:
|
||||||
|
m_NormalTrigger: Normal
|
||||||
|
m_HighlightedTrigger: Highlighted
|
||||||
|
m_PressedTrigger: Pressed
|
||||||
|
m_DisabledTrigger: Disabled
|
||||||
|
m_Interactable: 1
|
||||||
|
m_TargetGraphic: {fileID: 114826362001716654}
|
||||||
|
m_OnClick:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 0}
|
||||||
|
m_MethodName:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Arguments:
|
||||||
|
m_ObjectArgument: {fileID: 0}
|
||||||
|
m_ObjectArgumentAssemblyTypeName:
|
||||||
|
m_IntArgument: 0
|
||||||
|
m_FloatArgument: 0
|
||||||
|
m_StringArgument:
|
||||||
|
m_BoolArgument: 0
|
||||||
|
m_CallState: 2
|
||||||
|
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
--- !u!114 &114344768413473294
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1728513650105062}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 6d54531977ecb194c95e2d3aa7a5d72a, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_ControlPath: /<Keyboard>/a
|
||||||
|
m_UsePressure: 0
|
||||||
|
--- !u!114 &114547973042304788
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1977925927173892}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_FontData:
|
||||||
|
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_FontSize: 14
|
||||||
|
m_FontStyle: 0
|
||||||
|
m_BestFit: 0
|
||||||
|
m_MinSize: 10
|
||||||
|
m_MaxSize: 40
|
||||||
|
m_Alignment: 4
|
||||||
|
m_AlignByGeometry: 0
|
||||||
|
m_RichText: 1
|
||||||
|
m_HorizontalOverflow: 0
|
||||||
|
m_VerticalOverflow: 0
|
||||||
|
m_LineSpacing: 1
|
||||||
|
m_Text: Keyboard 'A' Key
|
||||||
|
--- !u!114 &114826362001716654
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1728513650105062}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_Type: 1
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
--- !u!222 &222401134047137570
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1728513650105062}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!222 &222878083001498966
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1977925927173892}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!224 &224750732080817856
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1977925927173892}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 224771122883764374}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!224 &224771122883764374
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1728513650105062}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 224750732080817856}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 100, y: 100}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 05f32eddd3e41fd4597ada617b785928
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 100100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 011b162d4daa13c4ab03e94ad47b8258
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1001 &100100000
|
||||||
|
Prefab:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications: []
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 0}
|
||||||
|
m_RootGameObject: {fileID: 1613174875475300}
|
||||||
|
m_IsPrefabAsset: 1
|
||||||
|
--- !u!1 &1080311573403324
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 224063307367997780}
|
||||||
|
- component: {fileID: 222676770552705204}
|
||||||
|
- component: {fileID: 114017654419583406}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Text
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!1 &1613174875475300
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 224091927000801720}
|
||||||
|
- component: {fileID: 222418917327610168}
|
||||||
|
- component: {fileID: 114144114248384442}
|
||||||
|
- component: {fileID: 114480945186419424}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Stick
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &114017654419583406
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1080311573403324}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_FontData:
|
||||||
|
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_FontSize: 14
|
||||||
|
m_FontStyle: 0
|
||||||
|
m_BestFit: 0
|
||||||
|
m_MinSize: 10
|
||||||
|
m_MaxSize: 40
|
||||||
|
m_Alignment: 4
|
||||||
|
m_AlignByGeometry: 0
|
||||||
|
m_RichText: 1
|
||||||
|
m_HorizontalOverflow: 0
|
||||||
|
m_VerticalOverflow: 0
|
||||||
|
m_LineSpacing: 1
|
||||||
|
m_Text: Left Stick
|
||||||
|
--- !u!114 &114144114248384442
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1613174875475300}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_Sprite: {fileID: 21300002, guid: e97a8ef01555d4941bdbc5eb5b056469, type: 3}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
--- !u!114 &114480945186419424
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1613174875475300}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e9d677f1681015749b15c436eec6d880, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_ControlPath: /<GamePad>/LeftStick
|
||||||
|
MovementRange: 50
|
||||||
|
deltaPos: {x: 0, y: 0, z: 0}
|
||||||
|
stickX: 0
|
||||||
|
stickY: 0
|
||||||
|
--- !u!222 &222418917327610168
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1613174875475300}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!222 &222676770552705204
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1080311573403324}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!224 &224063307367997780
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1080311573403324}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 224091927000801720}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
|
m_AnchoredPosition: {x: 2, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!224 &224091927000801720
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 100100000}
|
||||||
|
m_GameObject: {fileID: 1613174875475300}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 224063307367997780}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: -199, y: -120}
|
||||||
|
m_SizeDelta: {x: 100, y: 100}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f77f88b14a477764bb65a49d28c02d33
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 100100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1171,7 +1171,6 @@ GameObject:
|
|||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 2046150435}
|
- component: {fileID: 2046150435}
|
||||||
- component: {fileID: 2046150434}
|
- component: {fileID: 2046150434}
|
||||||
- component: {fileID: 2046150436}
|
|
||||||
- component: {fileID: 2046150437}
|
- component: {fileID: 2046150437}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Player
|
m_Name: Player
|
||||||
@@ -1224,73 +1223,6 @@ Transform:
|
|||||||
- {fileID: 1414446906}
|
- {fileID: 1414446906}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &2046150436
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2046150433}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_Actions: {fileID: -944628639613478452, guid: 5e793873f5ce73a44939dbee73949cf5,
|
|
||||||
type: 3}
|
|
||||||
m_NotificationBehavior: 2
|
|
||||||
m_UIInputModule: {fileID: 0}
|
|
||||||
m_DeviceLostEvent:
|
|
||||||
m_PersistentCalls:
|
|
||||||
m_Calls: []
|
|
||||||
m_DeviceRegainedEvent:
|
|
||||||
m_PersistentCalls:
|
|
||||||
m_Calls: []
|
|
||||||
m_ControlsChangedEvent:
|
|
||||||
m_PersistentCalls:
|
|
||||||
m_Calls: []
|
|
||||||
m_ActionEvents:
|
|
||||||
- m_PersistentCalls:
|
|
||||||
m_Calls:
|
|
||||||
- m_Target: {fileID: 2046150437}
|
|
||||||
m_TargetAssemblyTypeName: StudyCase2.ThirdCharacterController, Assembly-CSharp
|
|
||||||
m_MethodName: OnMove
|
|
||||||
m_Mode: 0
|
|
||||||
m_Arguments:
|
|
||||||
m_ObjectArgument: {fileID: 0}
|
|
||||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
|
||||||
m_IntArgument: 0
|
|
||||||
m_FloatArgument: 0
|
|
||||||
m_StringArgument:
|
|
||||||
m_BoolArgument: 0
|
|
||||||
m_CallState: 2
|
|
||||||
m_ActionId: 63773009-fafb-4bdb-ba8d-03f1bdcb54cf
|
|
||||||
m_ActionName: Controller1/Move[/Keyboard/w,/Keyboard/s,/Keyboard/a,/Keyboard/d]
|
|
||||||
- m_PersistentCalls:
|
|
||||||
m_Calls:
|
|
||||||
- m_Target: {fileID: 2046150437}
|
|
||||||
m_TargetAssemblyTypeName: StudyCase2.ThirdCharacterController, Assembly-CSharp
|
|
||||||
m_MethodName: OnJump
|
|
||||||
m_Mode: 0
|
|
||||||
m_Arguments:
|
|
||||||
m_ObjectArgument: {fileID: 0}
|
|
||||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
|
||||||
m_IntArgument: 0
|
|
||||||
m_FloatArgument: 0
|
|
||||||
m_StringArgument:
|
|
||||||
m_BoolArgument: 0
|
|
||||||
m_CallState: 2
|
|
||||||
m_ActionId: 28dcfdb3-71e3-46bd-9e4a-194bf7ea5554
|
|
||||||
m_ActionName: Controller1/Jump[/Keyboard/space]
|
|
||||||
- m_PersistentCalls:
|
|
||||||
m_Calls: []
|
|
||||||
m_ActionId: 00f03ea3-4718-40dc-a561-de734a33a0fa
|
|
||||||
m_ActionName: Controller/Pick[/Keyboard/f]
|
|
||||||
m_NeverAutoSwitchControlSchemes: 0
|
|
||||||
m_DefaultControlScheme:
|
|
||||||
m_DefaultActionMap: Controller
|
|
||||||
m_SplitScreenIndex: -1
|
|
||||||
m_Camera: {fileID: 0}
|
|
||||||
--- !u!114 &2046150437
|
--- !u!114 &2046150437
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1303,11 +1235,6 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: dd1d558f25085d447a5e81522e221905, type: 3}
|
m_Script: {fileID: 11500000, guid: dd1d558f25085d447a5e81522e221905, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
characterController: {fileID: 2046150434}
|
|
||||||
animator: {fileID: 1496151603}
|
|
||||||
forward: {fileID: 91895208}
|
|
||||||
model: {fileID: 1390492694}
|
|
||||||
vCam: {fileID: 1414446907}
|
|
||||||
moveSpeed: 5
|
moveSpeed: 5
|
||||||
jumpSpeed: 2
|
jumpSpeed: 2
|
||||||
turnSpeed: 10
|
turnSpeed: 10
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 94148b451f3cd28429d6e1540ba2ecf7
|
guid: 72f0edbd8a9cb814a998767dcb891cfc
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
4254
Assets/Scenes/Test.unity
Normal file
4254
Assets/Scenes/Test.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/Test.unity.meta
Normal file
7
Assets/Scenes/Test.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 94148b451f3cd28429d6e1540ba2ecf7
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
@@ -6,17 +5,32 @@ namespace StudyCase2
|
|||||||
{
|
{
|
||||||
public class ThirdCharacterController : MonoBehaviour
|
public class ThirdCharacterController : MonoBehaviour
|
||||||
{
|
{
|
||||||
public CharacterController characterController;
|
CharacterController characterController;
|
||||||
public Animator animator;
|
InputActionAsset inputAction;
|
||||||
public Transform forward;
|
Animator animator;
|
||||||
public Transform model;
|
Transform forward;
|
||||||
public Cinemachine.CinemachineVirtualCamera vCam;
|
Transform model;
|
||||||
|
Cinemachine.CinemachineVirtualCamera vCam;
|
||||||
public float moveSpeed = 5f;
|
public float moveSpeed = 5f;
|
||||||
public float jumpSpeed = 2f;
|
public float jumpSpeed = 2f;
|
||||||
public float turnSpeed = 10f;
|
public float turnSpeed = 10f;
|
||||||
public float gravity = 10f;
|
public float gravity = 10f;
|
||||||
Vector3 moveDir;
|
Vector3 moveDir;
|
||||||
Vector2 moveInput;
|
Vector2 moveInput;
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
characterController = GetComponent<CharacterController>();
|
||||||
|
forward = transform.Find("Forward");
|
||||||
|
model = transform.Find("Model");
|
||||||
|
animator = model.GetComponentInChildren<Animator>();
|
||||||
|
vCam = transform.Find("Virtual Camera").GetComponent<Cinemachine.CinemachineVirtualCamera>();
|
||||||
|
inputAction = Resources.Load<InputActionAsset>("Player");
|
||||||
|
inputAction.FindAction("Move").started += OnMove;
|
||||||
|
inputAction.FindAction("Move").performed += OnMove;
|
||||||
|
inputAction.FindAction("Move").canceled += OnMove;
|
||||||
|
inputAction.FindAction("Jump").performed += OnJump;
|
||||||
|
inputAction.Enable();
|
||||||
|
}
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
moveDir = new Vector3(moveInput.x, moveDir.y, moveInput.y);
|
moveDir = new Vector3(moveInput.x, moveDir.y, moveInput.y);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 35960d40ccba217429ab4b8d7c83c5e5
|
guid: fe017d4a95c024040a69a64495c7528a
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
|
|||||||
@@ -4,31 +4,20 @@ namespace StudyCase3
|
|||||||
{
|
{
|
||||||
public class Item : MonoBehaviour
|
public class Item : MonoBehaviour
|
||||||
{
|
{
|
||||||
public bool pick;
|
|
||||||
Outline outline;
|
Outline outline;
|
||||||
|
bool pick;
|
||||||
|
ThirdCharacterController player;
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
player = FindAnyObjectByType<ThirdCharacterController>();
|
||||||
if (outline == null)
|
if (outline == null)
|
||||||
outline = gameObject.AddComponent<Outline>();
|
outline = gameObject.AddComponent<Outline>();
|
||||||
else
|
else
|
||||||
outline = GetComponent<Outline>();
|
outline = GetComponent<Outline>();
|
||||||
|
outline.enabled = false;
|
||||||
outline.OutlineMode = Outline.Mode.OutlineVisible;
|
outline.OutlineMode = Outline.Mode.OutlineVisible;
|
||||||
outline.OutlineColor = new Color(0, 1, 1);
|
outline.OutlineColor = new Color(0, 1, 1);
|
||||||
outline.OutlineWidth = 10f;
|
outline.OutlineWidth = 10f;
|
||||||
outline.enabled = false;
|
|
||||||
gameObject.layer = LayerMask.NameToLayer("Item");
|
|
||||||
}
|
|
||||||
public void PickUp(Transform root)
|
|
||||||
{
|
|
||||||
pick = true;
|
|
||||||
outline.OutlineWidth = 2f;
|
|
||||||
gameObject.layer = LayerMask.NameToLayer("Default");
|
|
||||||
transform.SetParent(root);
|
|
||||||
}
|
|
||||||
public void UnPickUp()
|
|
||||||
{
|
|
||||||
pick = false;
|
|
||||||
outline.OutlineWidth = 10f;
|
|
||||||
gameObject.layer = LayerMask.NameToLayer("Item");
|
gameObject.layer = LayerMask.NameToLayer("Item");
|
||||||
}
|
}
|
||||||
public void Select()
|
public void Select()
|
||||||
@@ -41,5 +30,29 @@ namespace StudyCase3
|
|||||||
if (!pick)
|
if (!pick)
|
||||||
outline.enabled = false;
|
outline.enabled = false;
|
||||||
}
|
}
|
||||||
|
public void PickUp(Transform root)
|
||||||
|
{
|
||||||
|
if (pick) return;
|
||||||
|
pick = true;
|
||||||
|
transform.SetParent(root);
|
||||||
|
outline.OutlineWidth = 2f;
|
||||||
|
gameObject.layer = LayerMask.NameToLayer("Default");
|
||||||
|
player.SetItems();
|
||||||
|
}
|
||||||
|
private void OnMouseEnter()
|
||||||
|
{
|
||||||
|
if (player.pickMode == PickMode.Mouse)
|
||||||
|
Select();
|
||||||
|
}
|
||||||
|
private void OnMouseExit()
|
||||||
|
{
|
||||||
|
if (player.pickMode == PickMode.Mouse)
|
||||||
|
UnSelect();
|
||||||
|
}
|
||||||
|
private void OnMouseDown()
|
||||||
|
{
|
||||||
|
if (player.pickMode == PickMode.Mouse)
|
||||||
|
PickUp(player.itemRoot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 77f9323b319c41c488194a8072690034
|
guid: d915cfc36d9949f419c265a71b18203c
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
|
|||||||
@@ -1,39 +1,60 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
namespace StudyCase3
|
namespace StudyCase3
|
||||||
{
|
{
|
||||||
|
public enum PickMode
|
||||||
|
{
|
||||||
|
RayCast,
|
||||||
|
Mouse
|
||||||
|
}
|
||||||
public class ThirdCharacterController : MonoBehaviour
|
public class ThirdCharacterController : MonoBehaviour
|
||||||
{
|
{
|
||||||
public CharacterController characterController;
|
[Header("MoveSettings")]
|
||||||
public Animator animator;
|
CharacterController characterController;
|
||||||
public Transform forward;
|
InputActionAsset inputAction;
|
||||||
public Transform model;
|
Animator animator;
|
||||||
public Transform items;
|
Transform forward;
|
||||||
public Cinemachine.CinemachineVirtualCamera vCam;
|
Transform model;
|
||||||
|
Cinemachine.CinemachineVirtualCamera vCam;
|
||||||
public float moveSpeed = 5f;
|
public float moveSpeed = 5f;
|
||||||
public float jumpSpeed = 2f;
|
public float jumpSpeed = 2f;
|
||||||
public float turnSpeed = 10f;
|
public float turnSpeed = 10f;
|
||||||
public float gravity = 10f;
|
public float gravity = 10f;
|
||||||
public bool pickUpByCollider;
|
|
||||||
public float maxDistance = 5f;
|
|
||||||
public LayerMask layer;
|
|
||||||
public float itemsRotateSpeed = 100f;
|
|
||||||
|
|
||||||
Vector3 moveDir;
|
Vector3 moveDir;
|
||||||
Vector2 moveInput;
|
Vector2 moveInput;
|
||||||
|
[Header("PickSettings")]
|
||||||
|
public PickMode pickMode = PickMode.RayCast;
|
||||||
|
public CursorLockMode cursorLock;
|
||||||
|
public bool useDrawRay = true;
|
||||||
|
public float maxDistance = 5f;
|
||||||
|
public LayerMask layerMask;
|
||||||
|
public float itemsRotateSpeed = 120f;
|
||||||
|
public Transform itemRoot;
|
||||||
Item selectItem;
|
Item selectItem;
|
||||||
private void Start()
|
LineRenderer lineRenderer;
|
||||||
|
private void Awake()
|
||||||
{
|
{
|
||||||
Cursor.lockState = CursorLockMode.Locked;
|
Cursor.lockState = cursorLock;
|
||||||
|
characterController = GetComponent<CharacterController>();
|
||||||
|
forward = transform.Find("Forward");
|
||||||
|
model = transform.Find("Model");
|
||||||
|
animator = model.GetComponentInChildren<Animator>();
|
||||||
|
vCam = transform.Find("Virtual Camera").GetComponent<Cinemachine.CinemachineVirtualCamera>();
|
||||||
|
inputAction = Resources.Load<InputActionAsset>("Player");
|
||||||
|
inputAction.FindAction("Move").started += OnMove;
|
||||||
|
inputAction.FindAction("Move").performed += OnMove;
|
||||||
|
inputAction.FindAction("Move").canceled += OnMove;
|
||||||
|
inputAction.FindAction("Jump").performed += OnJump;
|
||||||
|
inputAction.FindAction("Pick").performed += OnPickUp;
|
||||||
|
inputAction.Enable();
|
||||||
|
itemRoot = transform.Find("ItemRoot");
|
||||||
}
|
}
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
Move();
|
Move();
|
||||||
RotationItems();
|
|
||||||
CheckRayHit();
|
CheckRayHit();
|
||||||
|
ItemsRotate();
|
||||||
}
|
}
|
||||||
public void OnMove(InputAction.CallbackContext context)
|
public void OnMove(InputAction.CallbackContext context)
|
||||||
{
|
{
|
||||||
@@ -48,15 +69,6 @@ namespace StudyCase3
|
|||||||
moveDir.y = jumpSpeed;
|
moveDir.y = jumpSpeed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void OnPickUp(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
if (context.performed && selectItem!=null)
|
|
||||||
{
|
|
||||||
selectItem.PickUp(items);
|
|
||||||
selectItem = null;
|
|
||||||
RearrangeItems();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void Move()
|
void Move()
|
||||||
{
|
{
|
||||||
moveDir = new Vector3(moveInput.x, moveDir.y, moveInput.y);
|
moveDir = new Vector3(moveInput.x, moveDir.y, moveInput.y);
|
||||||
@@ -73,14 +85,24 @@ namespace StudyCase3
|
|||||||
moveDir.y -= gravity * Time.deltaTime;
|
moveDir.y -= gravity * Time.deltaTime;
|
||||||
characterController.Move(moveDir * moveSpeed * Time.deltaTime);
|
characterController.Move(moveDir * moveSpeed * Time.deltaTime);
|
||||||
}
|
}
|
||||||
|
#region PickUp
|
||||||
|
public void OnPickUp(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
if (pickMode != PickMode.RayCast) return;
|
||||||
|
if (selectItem != null)
|
||||||
|
selectItem.PickUp(itemRoot);
|
||||||
|
selectItem = null;
|
||||||
|
}
|
||||||
void CheckRayHit()
|
void CheckRayHit()
|
||||||
{
|
{
|
||||||
|
if (pickMode != PickMode.RayCast) return;
|
||||||
Ray ray = new Ray(model.position, model.forward);
|
Ray ray = new Ray(model.position, model.forward);
|
||||||
RaycastHit hit;
|
RaycastHit hit;
|
||||||
if(Physics.Raycast(ray,out hit, maxDistance, layer))
|
if (Physics.Raycast(ray, out hit, maxDistance, layerMask))
|
||||||
{
|
{
|
||||||
Item curItem = hit.collider.GetComponent<Item>();
|
DrawRay(model.position, hit.point, new Color(0, 1, 1));
|
||||||
if (curItem && curItem != selectItem)
|
Item curItem = hit.transform.GetComponent<Item>();
|
||||||
|
if (curItem != null && curItem != selectItem)
|
||||||
{
|
{
|
||||||
if (selectItem != null)
|
if (selectItem != null)
|
||||||
selectItem.UnSelect();
|
selectItem.UnSelect();
|
||||||
@@ -90,31 +112,49 @@ namespace StudyCase3
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
DrawRay(model.position, model.position+ model.forward* maxDistance, new Color(1, 1, 1));
|
||||||
if (selectItem != null)
|
if (selectItem != null)
|
||||||
selectItem.UnSelect();
|
selectItem.UnSelect();
|
||||||
selectItem = null;
|
selectItem = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void RotationItems()
|
void DrawRay(Vector3 startPos, Vector3 endPos, Color color)
|
||||||
{
|
{
|
||||||
items.transform.Rotate(0, itemsRotateSpeed*Time.deltaTime, 0);
|
if (lineRenderer == null)
|
||||||
|
{
|
||||||
|
lineRenderer = gameObject.AddComponent<LineRenderer>();
|
||||||
|
lineRenderer.material = new Material(Shader.Find("Universal Render Pipeline/2D/Sprite-Unlit-Default"));
|
||||||
|
lineRenderer.useWorldSpace = true;
|
||||||
}
|
}
|
||||||
void RearrangeItems()
|
if (!useDrawRay)
|
||||||
|
{
|
||||||
|
lineRenderer.enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lineRenderer.startColor = lineRenderer.endColor = color;
|
||||||
|
lineRenderer.startWidth = lineRenderer.endWidth = 0.1f;
|
||||||
|
lineRenderer.positionCount = 2;
|
||||||
|
lineRenderer.SetPosition(0, startPos);
|
||||||
|
lineRenderer.SetPosition(1, endPos);
|
||||||
|
lineRenderer.enabled = true;
|
||||||
|
}
|
||||||
|
void ItemsRotate()
|
||||||
|
{
|
||||||
|
itemRoot.Rotate(0,itemsRotateSpeed*Time.deltaTime, 0);
|
||||||
|
}
|
||||||
|
public void SetItems()
|
||||||
{
|
{
|
||||||
int childCount = items.childCount;
|
|
||||||
if (childCount == 0) return;
|
|
||||||
|
|
||||||
float radius = 1.5f;
|
float radius = 1.5f;
|
||||||
float angleStep = 360f / childCount;
|
float angleStep = 360 / itemRoot.childCount;
|
||||||
|
for (int i = 0; i < itemRoot.childCount; i++)
|
||||||
for (int i = 0; i < childCount; i++)
|
|
||||||
{
|
{
|
||||||
Transform item = items.GetChild(i);
|
Transform item = itemRoot.GetChild(i);
|
||||||
float angle = i * angleStep;
|
float angle = angleStep * i;
|
||||||
Quaternion rotation = Quaternion.Euler(0, angle, 0);
|
Quaternion rot = Quaternion.Euler(0, angle, 0);
|
||||||
item.localPosition = rotation * Vector3.forward * radius;
|
item.localPosition = rot * itemRoot.forward * radius;
|
||||||
item.localScale = Vector3.one * 0.1f;
|
item.localScale = Vector3.one * 0.1f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c97885bac137e514d8f8607b1ac78653
|
guid: 460a2b895aff7e848bd63babe00d6f49
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
|
|||||||
8
Assets/ThirdParty.meta
Normal file
8
Assets/ThirdParty.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2011f9b40cc6efa47b8a9579ab0feb7a
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user