Markers?
This commit is contained in:
1 parent
d3b2e4c8d8
commit
2bd71f8dc5
76 files changed
+74739
-165606
No files matched your search
@@ -12,6 +12,7 @@ using Code.Infrastructure.Utils;
|
||||
using Code.OfficeGame.BattleMode.Actions;
|
||||
using Code.OfficeGame.BattleMode.Actions.Attacks;
|
||||
using Code.OfficeGame.BattleMode.Actions.Player;
|
||||
using Code.OfficeGame.BattleMode.Marker;
|
||||
using Code.OfficeGame.BattleMode.UI;
|
||||
using Code.OfficeGame.Player;
|
||||
using Cysharp.Threading.Tasks;
|
||||
@@ -91,17 +92,13 @@ namespace Code.Game.TestingLevel
|
||||
(BattleTimelinePanel)await Context.UIFactory
|
||||
.LoadPanel(UIPanelType.BattleTimelinePanel, false);
|
||||
|
||||
PlayerDecisionMarker playerDecisionMarker =
|
||||
Object.Instantiate(playerDecisionMarkerConfig.Config.PlayerDecisionMarkerPrefab);
|
||||
playerDecisionMarker.Toggle(false);
|
||||
Object.DontDestroyOnLoad(playerDecisionMarker);
|
||||
|
||||
// ((OpenMovementCameraState)Context.Camera.CurrentBaseState).SetTarget(player.transform);
|
||||
MarkerManager markerManager = new(playerDecisionMarkerConfig);
|
||||
|
||||
void InstallExtra(Scene scene, ContainerBuilder builder)
|
||||
{
|
||||
builder.RegisterValue(attackActionsConfigs);
|
||||
builder.RegisterValue(playerDecisionMarker);
|
||||
builder.RegisterValue(playerDecisionMarkerConfig);
|
||||
builder.RegisterValue(markerManager);
|
||||
|
||||
builder.RegisterValue(factoryConfig);
|
||||
builder.RegisterValue(factory, new[] { typeof(IPlayerFactory) });
|
||||
|
||||
@@ -82,6 +82,8 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
|
||||
if (_currentFrame == 0)
|
||||
{
|
||||
// TODO Root Motion не должен быть использован в нормальных анимациях
|
||||
animator.applyRootMotion = true;
|
||||
animator.Play(_attackData.StateHash, 0, 0f);
|
||||
}
|
||||
|
||||
@@ -116,7 +118,8 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
animator.Update(0f);
|
||||
_entityHitBoxes.DisableAllHitboxes();
|
||||
|
||||
// TODO С нормальными анимациями не нужен будет рут моушен
|
||||
// TODO С нормальными анимациями не нужен будет рут моушен√
|
||||
animator.applyRootMotion = false;
|
||||
animator.transform.localPosition = Vector3.zero;
|
||||
animator.transform.localRotation = Quaternion.identity;
|
||||
|
||||
@@ -129,6 +132,7 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
{
|
||||
if (_currentFrame == 0)
|
||||
{
|
||||
holoCop.Animator.applyRootMotion = true;
|
||||
holoCop.Animator.Play(_attackData.StateHash, 0, 0f);
|
||||
}
|
||||
|
||||
@@ -137,6 +141,7 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
if(_currentFrame >= _attackData.TotalFrames)
|
||||
{
|
||||
_currentFrame = 0;
|
||||
holoCop.Animator.applyRootMotion = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using Code.Game.Gameplay.Player;
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Input;
|
||||
using Code.OfficeGame.BattleMode.Actions.Player;
|
||||
using Code.OfficeGame.BattleMode.Marker;
|
||||
using Code.OfficeGame.BattleMode.Timeline;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using KinematicCharacterController;
|
||||
@@ -32,9 +33,9 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
public void Construct(
|
||||
CameraStateMachine cameraStateMachine,
|
||||
IInputService inputService,
|
||||
PlayerDecisionMarker playerDecisionMarker)
|
||||
MarkerManager markerManager)
|
||||
{
|
||||
_playerDecisionMarker = playerDecisionMarker;
|
||||
_markerManager = markerManager;
|
||||
_cameraStateMachine = cameraStateMachine;
|
||||
_inputService = inputService;
|
||||
_movementController = GetComponent<MovementController>();
|
||||
@@ -150,11 +151,15 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
_inputService.BindActionPerformed((int)ActionMappings.BattleMode, (int)BattleModeActions.Watchment,
|
||||
MarkPosition);
|
||||
|
||||
_playerLockedDecisionMarker = _markerManager.GetMarkerInstance();
|
||||
_playerDecisionMarker = _markerManager.GetMarkerInstance();
|
||||
_playerDecisionMarker.Toggle(true);
|
||||
|
||||
await UniTask.WaitUntilCanceled(_waitForEnterTokenSource.Token).SuppressCancellationThrow();
|
||||
|
||||
_playerDecisionMarker.Toggle(false);
|
||||
_markerManager.ReleaseMarkerInstance(_playerDecisionMarker);
|
||||
_markerManager.ReleaseMarkerInstance(_playerLockedDecisionMarker);
|
||||
|
||||
_inputService.UnbindActionPerformed((int)ActionMappings.BattleMode, (int)BattleModeActions.Select,
|
||||
SelectPosition);
|
||||
@@ -176,7 +181,7 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
public override BattleActionType ActionType => BattleActionType.Move;
|
||||
|
||||
private int _totalFrames;
|
||||
private PlayerDecisionMarker _playerDecisionMarker;
|
||||
private MarkerManager _markerManager;
|
||||
|
||||
private void CancelPosition(InputAction.CallbackContext obj)
|
||||
{
|
||||
@@ -234,6 +239,9 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
|
||||
private RaycastHit[] _hitBuffer = new RaycastHit[1];
|
||||
private Vector3 _lastViewedPosition;
|
||||
private PlayerDecisionMarker _playerDecisionMarker;
|
||||
private PlayerDecisionMarker _playerLockedDecisionMarker;
|
||||
|
||||
private void MarkPosition(InputAction.CallbackContext input)
|
||||
{
|
||||
var position = _cameraStateMachine.Camera.transform.position;
|
||||
@@ -252,16 +260,10 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
|
||||
private void SelectPosition(InputAction.CallbackContext input)
|
||||
{
|
||||
// var position = _cameraStateMachine.Camera.transform.position;
|
||||
// var direction = _cameraStateMachine.Camera.transform.forward;
|
||||
//
|
||||
// var didHit = Physics.Raycast(position, direction, out RaycastHit hit, Mathf.Infinity, _navMeshMask);
|
||||
//
|
||||
// if (!didHit) return;
|
||||
|
||||
Debug.Log($"Hit {_lastViewedPosition}");
|
||||
|
||||
_targetPosition = _lastViewedPosition;
|
||||
|
||||
_playerLockedDecisionMarker.MoveMarker(_targetPosition);
|
||||
_playerLockedDecisionMarker.Toggle(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,8 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
}
|
||||
public override async UniTask<BattleActionDecisionResult> DecideAction()
|
||||
{
|
||||
await UniTask.Yield();
|
||||
|
||||
_currentFrame = 0;
|
||||
Finished = false;
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
{
|
||||
Finished = false;
|
||||
|
||||
await UniTask.Yield();
|
||||
|
||||
_waitFrames = 120;
|
||||
|
||||
return new()
|
||||
|
||||
@@ -39,19 +39,15 @@ namespace Code.OfficeGame.BattleMode.Actions.HoloCopy
|
||||
_initialAnimationState = stateInfo.shortNameHash;
|
||||
_initialNormalizedTime = stateInfo.normalizedTime;
|
||||
|
||||
animator.applyRootMotion = false;
|
||||
animator.SetFloat(VelocityForward, originAnimator.GetFloat(VelocityForward));
|
||||
|
||||
animator.Play(_initialAnimationState, 0, _initialNormalizedTime);
|
||||
animator.Update(0f);
|
||||
|
||||
animator.applyRootMotion = true;
|
||||
}
|
||||
|
||||
private void ReturnToSnapshot()
|
||||
{
|
||||
bool prevRootMotion = animator.applyRootMotion;
|
||||
animator.applyRootMotion = false;
|
||||
|
||||
animator.Play(_initialAnimationState, 0, _initialNormalizedTime);
|
||||
animator.Update(0f);
|
||||
@@ -61,8 +57,6 @@ namespace Code.OfficeGame.BattleMode.Actions.HoloCopy
|
||||
|
||||
originMotor.SetPositionAndRotation(_initialMotorPosition, _initialMotorRotation);
|
||||
|
||||
animator.applyRootMotion = prevRootMotion;
|
||||
|
||||
Physics.SyncTransforms();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,17 +4,13 @@ namespace Code.OfficeGame.BattleMode.Actions.Player
|
||||
{
|
||||
public class PlayerDecisionMarker : MonoBehaviour
|
||||
{
|
||||
public bool locked;
|
||||
public void Toggle(bool onOff)
|
||||
{
|
||||
locked = false;
|
||||
gameObject.SetActive(onOff);
|
||||
}
|
||||
|
||||
public void MoveMarker(Vector3 position)
|
||||
{
|
||||
if (locked) return;
|
||||
|
||||
transform.position = position;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 527881ac6276480fa4c734f16ca1d2fc
|
||||
timeCreated: 1793204344
|
||||
@@ -0,0 +1,27 @@
|
||||
using Code.Infrastructure.Utils;
|
||||
using Code.OfficeGame.BattleMode.Actions.Player;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.OfficeGame.BattleMode.Marker
|
||||
{
|
||||
// TODO Сделать пул?
|
||||
public class MarkerManager
|
||||
{
|
||||
private PlayerDecisionMarkerConfig _playerDecisionMarkerConfig;
|
||||
|
||||
public MarkerManager(SingleConfig<PlayerDecisionMarkerConfig> config)
|
||||
{
|
||||
_playerDecisionMarkerConfig = config.Config;
|
||||
}
|
||||
|
||||
public PlayerDecisionMarker GetMarkerInstance()
|
||||
{
|
||||
PlayerDecisionMarker marker = Object.Instantiate(_playerDecisionMarkerConfig.PlayerDecisionMarkerPrefab);
|
||||
marker.Toggle(false);
|
||||
Object.DontDestroyOnLoad(marker);
|
||||
return marker;
|
||||
}
|
||||
|
||||
public void ReleaseMarkerInstance(PlayerDecisionMarker marker) => Object.Destroy(marker.gameObject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9056d229a6741f299714db3e799785b
|
||||
timeCreated: 1793204390
|
||||
@@ -49,7 +49,7 @@ namespace Code.OfficeGame.BattleMode.UI
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (OperationCanceledException ex)
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
return BattleActionType.None;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bcc3f5ec004d41e4a28fb5b83193c08
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,202 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-2583687123587248742
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: HoloCop
|
||||
m_Shader: {fileID: 4800000, guid: 22c8483a0088cff4ea29f92544b8304b, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _MK_SURFACE_TYPE_TRANSPARENT
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
stringTagMap:
|
||||
IGNOREPROJECTOR: true
|
||||
RenderType: Transparent
|
||||
disabledShaderPasses:
|
||||
- SHADOWCASTER
|
||||
- DepthOnly
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _AlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DissolveBorderRamp:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DissolveMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _NoiseMap:
|
||||
m_Texture: {fileID: 2800000, guid: b376780a16f30e141824d5baae6b8f5e, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _VertexAnimationMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AdvancedTab: 0
|
||||
- _AlbedoMapIntensity: 1
|
||||
- _AlembicMotionVectors: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaClipping: 0
|
||||
- _AlphaCutoff: 0.5
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendDst: 10
|
||||
- _BlendDstAlpha: 10
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BlendSrc: 5
|
||||
- _BlendSrcAlpha: 1
|
||||
- _Brightness: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _ColorGrading: 0
|
||||
- _Contrast: 1
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DetailUVSet: 0
|
||||
- _Dissolve: 0
|
||||
- _DissolveAmount: 0.5
|
||||
- _DissolveBorderSize: 0.25
|
||||
- _DissolveMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 0
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 0
|
||||
- _Hue: 0
|
||||
- _Initialized: 0
|
||||
- _InputTab: 1
|
||||
- _Metallic: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _OptionsTab: 1
|
||||
- _Parallax: 0.005
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _RenderFace: 2
|
||||
- _RenderPriority: 0
|
||||
- _Saturation: 1
|
||||
- _ScreenSpaceReflections: 1
|
||||
- _ScreenSpaceReflectionsContributeTransparent: 1
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Stencil: 1
|
||||
- _StencilComp: 8
|
||||
- _StencilFail: 0
|
||||
- _StencilPass: 0
|
||||
- _StencilReadMask: 255
|
||||
- _StencilRef: 0
|
||||
- _StencilWriteMask: 255
|
||||
- _StencilZFail: 0
|
||||
- _StylizeTab: 0
|
||||
- _Surface: 1
|
||||
- _VertexAnimation: 0
|
||||
- _VertexAnimationIntensity: 0.05
|
||||
- _VertexAnimationStutter: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZTest: 4
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _AlbedoColor: {r: 0.3721075, g: 0.525006, b: 0.6981132, a: 1}
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color: {r: 0.37210748, g: 0.525006, b: 0.6981132, a: 1}
|
||||
- _DissolveBorderColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
- _VertexAnimationFrequency: {r: 2.5, g: 2.5, b: 2.5, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 110b054cbfe874bf2bb643705c76dcb3
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,137 @@
|
||||
Shader "Custom/URP/GTASAHintMarker"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[ToggleUI] _Enabled ("Enabled", Float) = 1
|
||||
|
||||
[HDR] _HintColor ("Marker Color", Color) = (1, 0.8, 0, 0.5)
|
||||
|
||||
_FadeStart ("Fade Start Height (World Y)", Float) = 0.0
|
||||
_FadeEnd ("Fade End Height (World Y)", Float) = 2.0
|
||||
|
||||
_HoleRadius ("Hole Radius", Range(0.0, 1.0)) = 0.5
|
||||
_HoleSmoothness ("Hole Smoothness", Range(0.001, 0.5)) = 0.05
|
||||
|
||||
_PulseSpeed ("Pulse Speed", Float) = 6.0
|
||||
_PulseIntensity ("Pulse Intensity", Range(0, 1)) = 0.3
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"RenderType" = "Transparent"
|
||||
"Queue" = "Transparent+10"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
"IgnoreProjector" = "True"
|
||||
}
|
||||
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Unlit"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 3.0
|
||||
|
||||
#pragma multi_compile_instancing
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
// CBUFFER необходим для совместимости с SRP Batcher
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _HintColor;
|
||||
float _Enabled;
|
||||
float _FadeStart;
|
||||
float _FadeEnd;
|
||||
float _HoleRadius;
|
||||
float _HoleSmoothness;
|
||||
float _PulseSpeed;
|
||||
float _PulseIntensity;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
float3 normalOS : NORMAL;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float3 positionWS : TEXCOORD0;
|
||||
float3 positionOS : TEXCOORD1;
|
||||
float3 normalOS : NORMAL;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
Varyings vert(Attributes input)
|
||||
{
|
||||
Varyings output = (Varyings)0;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
UNITY_TRANSFER_INSTANCE_ID(input, output);
|
||||
|
||||
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
|
||||
|
||||
output.positionCS = vertexInput.positionCS;
|
||||
output.positionWS = vertexInput.positionWS;
|
||||
output.positionOS = input.positionOS.xyz;
|
||||
output.normalOS = input.normalOS;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 frag(Varyings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
|
||||
if (_Enabled < 0.5)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
// Отсечение верхней крышки цилиндра/маркера
|
||||
if (input.normalOS.y > 0.5 && input.positionOS.y > 0.0)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
// Вертикальный градиент затухания по высоте
|
||||
float heightRange = max(_FadeEnd - _FadeStart, 0.001);
|
||||
float gradient = saturate((input.positionWS.y - _FadeStart) / heightRange);
|
||||
float alphaFade = 1.0 - gradient;
|
||||
|
||||
// Маска отверстия в нижней части
|
||||
float distFromCenter = length(input.positionOS.xz);
|
||||
if (input.normalOS.y < -0.5)
|
||||
{
|
||||
float targetRadius = _HoleRadius * 0.5;
|
||||
float holeMask = smoothstep(targetRadius, targetRadius + _HoleSmoothness, distFromCenter);
|
||||
alphaFade *= holeMask;
|
||||
}
|
||||
|
||||
half4 finalColor = _HintColor;
|
||||
finalColor.a *= alphaFade;
|
||||
|
||||
// Пульсация прозрачности во времени
|
||||
float pulseWave = sin(_Time.y * _PulseSpeed) * 0.5 + 0.5;
|
||||
float pulse = (1.0 - _PulseIntensity) + pulseWave * _PulseIntensity;
|
||||
finalColor.a *= pulse;
|
||||
|
||||
return finalColor;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack "Hidden/Universal Render Pipeline/FallbackError"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93f4bcd58b74245ffaa7216d59c44570
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,146 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-3977986208587211418
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: PlayerDecisionMarker
|
||||
m_Shader: {fileID: 4800000, guid: 93f4bcd58b74245ffaa7216d59c44570, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 1
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _Enabled: 1
|
||||
- _EnvironmentReflections: 1
|
||||
- _FadeEnd: 2
|
||||
- _FadeStart: 0
|
||||
- _GlossMapScale: 0
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 0
|
||||
- _HoleRadius: 0.5
|
||||
- _HoleSmoothness: 0.05
|
||||
- _Metallic: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.005
|
||||
- _PulseIntensity: 0.3
|
||||
- _PulseSpeed: 6
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _ScreenSpaceReflections: 1
|
||||
- _ScreenSpaceReflectionsContributeTransparent: 1
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _HintColor: {r: 1, g: 0.8, b: 0, a: 0.5}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ade50ed2b9e940d3a3d338de41efeb8
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -45,7 +45,6 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 6dcb7d02c6a54c0a9758279c38260aef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Code.OfficeGame.BattleMode.Actions.Player.PlayerDecisionMarker
|
||||
locked: 0
|
||||
--- !u!1 &5211050770166458882
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -74,7 +73,7 @@ Transform:
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.05, z: 0}
|
||||
m_LocalScale: {x: 1, y: 0.1, z: 1}
|
||||
m_LocalScale: {x: 0.5, y: 0.1, z: 0.5}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1507626928637554511}
|
||||
@@ -112,7 +111,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
|
||||
- {fileID: 2100000, guid: 2ade50ed2b9e940d3a3d338de41efeb8, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -2128,6 +2128,10 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 342766060722697506}
|
||||
m_Modifications:
|
||||
- target: {fileID: -9114889020240603615, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: 'm_Materials.Array.data[0]'
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 110b054cbfe874bf2bb643705c76dcb3, type: 2}
|
||||
- target: {fileID: -8679921383154817045, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 80.4
|
||||
@@ -2184,6 +2188,10 @@ PrefabInstance:
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -7823293702887809713, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: 'm_Materials.Array.data[0]'
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 110b054cbfe874bf2bb643705c76dcb3, type: 2}
|
||||
- target: {fileID: -6452266432751415832, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
@@ -2208,6 +2216,14 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: Player_M1_1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1287542132067729854, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: 'm_Materials.Array.data[0]'
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 110b054cbfe874bf2bb643705c76dcb3, type: 2}
|
||||
- target: {fileID: 5797384429611982230, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: 'm_Materials.Array.data[0]'
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 110b054cbfe874bf2bb643705c76dcb3, type: 2}
|
||||
- target: {fileID: 5797954692085622370, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Player_M1
|
||||
@@ -2218,7 +2234,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 9100000, guid: 0a88085cbabf38ae084dd83fcdd5e566, type: 2}
|
||||
- target: {fileID: 5866666021909216657, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: m_ApplyRootMotion
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9148548460791437811, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
@@ -2337,7 +2353,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 9100000, guid: 0a88085cbabf38ae084dd83fcdd5e566, type: 2}
|
||||
- target: {fileID: 5866666021909216657, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: m_ApplyRootMotion
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9148548460791437811, guid: 22f5406d0dd3e496dab66400ad658fb8, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
|
||||
Reference in new issue
Block a user