This commit is contained in:
CortexCore
2023-11-15 23:54:54 +08:00
parent ee3ecec6cb
commit 3c837a4a33
356 changed files with 73756 additions and 26493 deletions

View 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()
{
}
}

View File

@@ -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)
{

View File

@@ -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);