+ 부스터 사용시 집중선(SpeedLines) 기능 추가 + 부스터 사용시 카메라 흔들림 효과 기능 추가 + 부스터 사용시 포스트프로세싱(Vignette) 기능 추가 + 부스터 소진시 내부적인 추가 부스터 시간 추가 + 추가 부스터까지 소진시 부스터 쿨타임 적용 ㄴ 기존의 이동속도보다 2배 느려지는 기능 추가 + ShipPlayer(배) 모델링 변경 ㄴ Hand_Painted_Boats(에셋 이름) + 배 변경에 따른 대포(Cannon) 변경 및 로직 수정 ㄴ 대포의 발사 각도 변경 ㄴ 대포의 스피드 변경 + 배의 움직임 로직 변경 ㄴ 일정한 속도로 회전 ㄴ Rigidbody Freeze Rotation + 중형 물고기 모델링 추가 ㄴ HammerHeadShark(망치머리상어) 추가 ㄴ Stingray(가오리) 추가 + Layer(PostProcessing) 추가 + VisualFeedbackManager에 포스트 프로세싱 기능 관련 추가
66 lines
2.1 KiB
C#
66 lines
2.1 KiB
C#
using UnityEngine;
|
|
|
|
namespace _02.Scripts
|
|
{
|
|
[ExecuteInEditMode]
|
|
public class SpeedLines : MonoBehaviour
|
|
{
|
|
[SerializeField] private Shader shader;
|
|
[SerializeField] private Texture texture;
|
|
[SerializeField] private Color color = new(1,1,1,0.1f);
|
|
|
|
[Range(0,1)]
|
|
[SerializeField] private float width = 0.4f;
|
|
[Range(0, 1)]
|
|
[SerializeField] private float length = 0.42f;
|
|
[Range(0, 100)]
|
|
[SerializeField] private float lengthSpeed = 17;
|
|
[Range(0, 1)]
|
|
[SerializeField] private float density = 0.75f;
|
|
|
|
private Material material;
|
|
|
|
private static readonly int Color = Shader.PropertyToID("_Color");
|
|
private static readonly int Width = Shader.PropertyToID("_Width");
|
|
private static readonly int Length = Shader.PropertyToID("_Length");
|
|
private static readonly int LengthSpeed = Shader.PropertyToID("_LengthSpeed");
|
|
private static readonly int Density = Shader.PropertyToID("_Density");
|
|
private static readonly int Fbm = Shader.PropertyToID("_FBM");
|
|
|
|
private void Awake()
|
|
{
|
|
if (material) return;
|
|
|
|
material = new Material(shader);
|
|
material.SetTexture(Fbm, texture);
|
|
}
|
|
|
|
private void LateUpdate()
|
|
{
|
|
material.SetColor(Color, color);
|
|
material.SetFloat(Width, width);
|
|
material.SetFloat(Length, length);
|
|
material.SetFloat(LengthSpeed, lengthSpeed);
|
|
material.SetFloat(Density, density);
|
|
}
|
|
|
|
public void OnRenderObject()
|
|
{
|
|
material.SetPass(0);
|
|
GL.PushMatrix();
|
|
GL.LoadOrtho();
|
|
|
|
GL.Begin(GL.QUADS);
|
|
GL.TexCoord(new Vector3(0, 0, 0));
|
|
GL.Vertex3(0, 0, 0);
|
|
GL.TexCoord(new Vector3(0, 1, 0));
|
|
GL.Vertex3(0, 1, 0);
|
|
GL.TexCoord(new Vector3(1, 1, 0));
|
|
GL.Vertex3(1, 1, 0);
|
|
GL.TexCoord(new Vector3(1, 0, 0));
|
|
GL.Vertex3(1, 0, 0);
|
|
GL.End();
|
|
GL.PopMatrix();
|
|
}
|
|
}
|
|
} |