1
This commit is contained in:
18
Assets/Artists/Scripts/Props/Prop_Flashbang.cs
Normal file
18
Assets/Artists/Scripts/Props/Prop_Flashbang.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Prop_Flashbang : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@@ -12,6 +12,7 @@ namespace BITFALL.Props
|
||||
{
|
||||
[SerializeField] private SpringEulerAngle spring=new();
|
||||
[SerializeField] private Optional<int> maxSpring;
|
||||
[SerializeField] private Optional<LocationAdditive> locationAdditive;
|
||||
public IUnityEntity UnityEntity => null;
|
||||
public Rigidbody Rigidbody => null;
|
||||
private Vector3 initialEulerAngles;
|
||||
@@ -25,6 +26,10 @@ namespace BITFALL.Props
|
||||
{
|
||||
spring.Update(Time.fixedDeltaTime,initialEulerAngles);
|
||||
transform.localEulerAngles = spring.value;
|
||||
if (locationAdditive.Allow)
|
||||
{
|
||||
locationAdditive.Value.AddEuler(spring.value-initialEulerAngles);
|
||||
}
|
||||
}
|
||||
public void GiveDamage(DamageMessage message)
|
||||
{
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BITKit;
|
||||
using BITKit.Entities;
|
||||
using Cysharp.Threading.Tasks;
|
||||
@@ -46,6 +47,10 @@ namespace BITFALL.Props
|
||||
}
|
||||
rigidbody.Sleep();
|
||||
|
||||
if (hit.collider.TryGetComponent<ITag>(out var tags))
|
||||
{
|
||||
DI.Get<VFXService>().Spawn(hit,tags.GetTags());
|
||||
}
|
||||
if (TryGetComponent<Prop_ReplaceOnSleep>(out var replace))
|
||||
{
|
||||
replace.ReplaceImmediate(hit.collider.transform);
|
||||
|
Reference in New Issue
Block a user