CGerrits SF
4 年前
当前提交
d0f44a55
共有 6 个文件被更改,包括 196 次插入 和 86 次删除
-
100Assets/BossRoom/Prefabs/Player.prefab
-
9Assets/BossRoom/Scripts/Client/ClientInputSender.cs
-
98Assets/BossRoom/Prefabs/Click_Feedback.prefab
-
7Assets/BossRoom/Prefabs/Click_Feedback.prefab.meta
-
57Assets/BossRoom/Scripts/Client/ClickFeedback.cs
-
11Assets/BossRoom/Scripts/Client/ClickFeedback.cs.meta
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &9137928905311479176 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 2500332623759108304} |
|||
- component: {fileID: 6101625250476277925} |
|||
- component: {fileID: 6375111725193425194} |
|||
- component: {fileID: 7164482062141736850} |
|||
m_Layer: 0 |
|||
m_Name: Click_Feedback |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &2500332623759108304 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 9137928905311479176} |
|||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} |
|||
m_LocalPosition: {x: 0, y: 0, z: 0} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} |
|||
--- !u!33 &6101625250476277925 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 9137928905311479176} |
|||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!23 &6375111725193425194 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 9137928905311479176} |
|||
m_Enabled: 1 |
|||
m_CastShadows: 1 |
|||
m_ReceiveShadows: 1 |
|||
m_DynamicOccludee: 1 |
|||
m_MotionVectors: 1 |
|||
m_LightProbeUsage: 1 |
|||
m_ReflectionProbeUsage: 1 |
|||
m_RayTracingMode: 2 |
|||
m_RayTraceProcedural: 0 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_StaticBatchInfo: |
|||
firstSubMesh: 0 |
|||
subMeshCount: 0 |
|||
m_StaticBatchRoot: {fileID: 0} |
|||
m_ProbeAnchor: {fileID: 0} |
|||
m_LightProbeVolumeOverride: {fileID: 0} |
|||
m_ScaleInLightmap: 1 |
|||
m_ReceiveGI: 1 |
|||
m_PreserveUVs: 0 |
|||
m_IgnoreNormalsForChartDetection: 0 |
|||
m_ImportantGI: 0 |
|||
m_StitchLightmapSeams: 1 |
|||
m_SelectedEditorRenderState: 3 |
|||
m_MinimumChartSize: 4 |
|||
m_AutoUVMaxDistance: 0.5 |
|||
m_AutoUVMaxAngle: 89 |
|||
m_LightmapParameters: {fileID: 0} |
|||
m_SortingLayerID: 0 |
|||
m_SortingLayer: 0 |
|||
m_SortingOrder: 0 |
|||
m_AdditionalVertexStreams: {fileID: 0} |
|||
--- !u!64 &7164482062141736850 |
|||
MeshCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 9137928905311479176} |
|||
m_Material: {fileID: 0} |
|||
m_IsTrigger: 0 |
|||
m_Enabled: 1 |
|||
serializedVersion: 4 |
|||
m_Convex: 0 |
|||
m_CookingOptions: 30 |
|||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} |
|
|||
fileFormatVersion: 2 |
|||
guid: 86bfc5d7bdc268842947478bcdd38c08 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
namespace BossRoom.Client |
|||
{ |
|||
/**Responsible for managing and creating a feedback icon where the player clicked to move */ |
|||
[RequireComponent(typeof(ClientInputSender))] |
|||
public class ClickFeedback : MonoBehaviour |
|||
{ |
|||
[SerializeField] |
|||
GameObject feedbackPrefab; |
|||
private GameObject feedbackObj; |
|||
private ClientInputSender m_ClientSender; |
|||
private float lastClicked; |
|||
|
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
m_ClientSender = GetComponent<ClientInputSender>(); |
|||
m_ClientSender.OnClientClick += onClick; |
|||
lastClicked = Time.time; |
|||
} |
|||
|
|||
void onClick(Vector3 position) |
|||
{ |
|||
|
|||
if (!feedbackObj) |
|||
{ |
|||
feedbackObj = Instantiate(feedbackPrefab); |
|||
} |
|||
position.y += .1f; |
|||
|
|||
feedbackObj.transform.position = position; |
|||
feedbackObj.SetActive(true); |
|||
|
|||
lastClicked = Time.time; |
|||
} |
|||
|
|||
|
|||
// Update is called once per frame
|
|||
void Update() |
|||
{ |
|||
if (feedbackObj && Time.time - lastClicked >= .75) |
|||
{ |
|||
Destroy(feedbackObj); |
|||
feedbackObj = null; |
|||
} |
|||
} |
|||
|
|||
private void OnDestroy() |
|||
{ |
|||
m_ClientSender.OnClientClick -= onClick; |
|||
} |
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 2d0d8ed0724e1404d9d0afcd9b8b5ee2 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue