This commit is contained in:
hyskai 2024-10-23 11:29:08 +08:00
parent 93aad738cf
commit 7d6b6f49ca
7 changed files with 9990 additions and 82 deletions

View File

@ -395,7 +395,7 @@ Material:
- _Diffusion_Profile_Asset: {r: -8.489958e-35, g: 6.00157e-17, b: -1.2974213e-37, a: 5.5824003e+25}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _Emission_Color: {r: 135.58704, g: 0, b: 0, a: 0}
- _Emission_Color: {r: 102.463745, g: 17.180916, b: 0, a: 1}
- _Emission_Gradient_Color: {r: 25.992073, g: 3.5675397, b: 0, a: 0}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e108ee0dd36dd0c4283d978e722a808a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f382056a7865fbf4f8ab598ce40ebe10
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -557,15 +557,15 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 331024032}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 5.89}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.3515401, y: 5.8199997, z: -0.108633086}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1272251531}
- {fileID: 658795003}
m_Father: {fileID: 1925726372}
m_RootOrder: 0
m_Father: {fileID: 522793790}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &366303167
GameObject:
@ -1173,6 +1173,160 @@ MeshCollider:
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 8288912951170817853, guid: 99b24141689a83043b92139443bf04a5, type: 3}
--- !u!1001 &522793789
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 2093116385}
m_Modifications:
- target: {fileID: -5541609067895087839, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalPosition.x
value: -16.41
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalPosition.y
value: 0.07
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalPosition.z
value: 4.28
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalRotation.y
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_Name
value: firelive
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_Layer
value: 3
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_TagString
value: Wall
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 7334764585934320612, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_Layer
value: 3
objectReference: {fileID: 0}
- target: {fileID: 7334764585934320612, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
--- !u!4 &522793790 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
m_PrefabInstance: {fileID: 522793789}
m_PrefabAsset: {fileID: 0}
--- !u!1 &522793791 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7334764585934320612, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
m_PrefabInstance: {fileID: 522793789}
m_PrefabAsset: {fileID: 0}
--- !u!1 &522793792 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -927199367670048503, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
m_PrefabInstance: {fileID: 522793789}
m_PrefabAsset: {fileID: 0}
--- !u!64 &522793793
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 522793791}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 3766872523510208827, guid: 062c3db07b863f644a93bc3f63e6644b, type: 3}
--- !u!65 &522793795
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 522793792}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 4.682661, y: 1.4791763, z: 1.4127792}
m_Center: {x: -0.08568764, y: -0.011386454, z: 0.03894791}
--- !u!114 &522793796
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 522793792}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f5ab85ae1be49d247be04e8ebf56d7b5, type: 3}
m_Name:
m_EditorClassIdentifier:
minfire: {fileID: 1804328903033968817, guid: f382056a7865fbf4f8ab598ce40ebe10, type: 3}
bigfire: {fileID: 8237205645370001511, guid: e108ee0dd36dd0c4283d978e722a808a, type: 3}
FireNumber: 1
bigFireNumber: 5
spreadRadius: 3
windDirection: 0
SpreadFireNumber: 1
--- !u!1 &531870582
GameObject:
m_ObjectHideFlags: 0
@ -2875,6 +3029,57 @@ Transform:
m_Father: {fileID: 1418510104}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!1 &1594313788
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1594313789}
- component: {fileID: 1594313790}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1594313789
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1594313788}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -16.477066, y: -0.107232094, z: 14.49}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1594313790
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1594313788}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f5ab85ae1be49d247be04e8ebf56d7b5, type: 3}
m_Name:
m_EditorClassIdentifier:
minfire: {fileID: 1804328903033968817, guid: f382056a7865fbf4f8ab598ce40ebe10, type: 3}
bigfire: {fileID: 8237205645370001511, guid: e108ee0dd36dd0c4283d978e722a808a, type: 3}
FireNumber: 1
bigFireNumber: 20
spreadRadius: 3
windDirection: 0
SpreadFireNumber: 3
--- !u!1001 &1660298594
PrefabInstance:
m_ObjectHideFlags: 0
@ -3280,80 +3485,6 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1849834543}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1925726371
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1925726372}
- component: {fileID: 1925726374}
- component: {fileID: 1925726373}
- component: {fileID: 1925726375}
m_Layer: 7
m_Name: Fire
m_TagString: fire
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1925726372
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1925726371}
m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5}
m_LocalPosition: {x: -16.518633, y: 0, z: 4.6315403}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 331024033}
m_Father: {fileID: 2093116385}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!135 &1925726373
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1925726371}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 3
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1925726374
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1925726371}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8f4189fe310885b45b10fb435499ae64, type: 3}
m_Name:
m_EditorClassIdentifier:
extinguishTime: 3
--- !u!114 &1925726375
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1925726371}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f5ab85ae1be49d247be04e8ebf56d7b5, type: 3}
m_Name:
m_EditorClassIdentifier:
fire: {fileID: 7216750062051536991, guid: 9f7fd162e0c30ac4cb6ceffdb2a2b45e, type: 3}
--- !u!1 &1992817849
GameObject:
m_ObjectHideFlags: 0
@ -3561,7 +3692,7 @@ Transform:
- {fileID: 328787070}
- {fileID: 1035101460}
- {fileID: 1418510104}
- {fileID: 1925726372}
- {fileID: 522793790}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -2,18 +2,126 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/*
*/
public class Firelive : MonoBehaviour
{
public GameObject fire;
//火焰预制体
public GameObject minfire;
public GameObject bigfire;
//火势值,用于判断火是否灭,是否变大
private float fireNumber=0;
//每秒的火势值
public float FireNumber;
//判定大火小火的值
public float bigFireNumber;
//生成半径
public float spreadRadius;
public enum WindDirection { North, South, East, West }
public WindDirection windDirection = WindDirection.North; // 风向
private bool isBurning = false;
private GameObject currentFire; // 当前生成的火焰实例
public int SpreadFireNumber=1;
private bool Canbig = true;
// Start is called before the first frame update
void Start()
{
StartBurning();
}
// Update is called once per frame
void Update()
{
if (isBurning&&Canbig)
{
// 检查火势值是否超过阈值
if (fireNumber< bigFireNumber)
{
fireNumber += FireNumber * Time.deltaTime;
return;
}
SwitchToMaxFire();
}
}
//火焰初始化
private void StartBurning()
{
if (!isBurning)
{
isBurning = true;
// 初始在pos位置生成小火焰预制体
currentFire = Instantiate(minfire, transform.position, Quaternion.identity);
}
}
private void SwitchToMaxFire()
{
// 销毁当前小火焰,替换为大火焰
Destroy(currentFire);
currentFire=Instantiate(bigfire, transform.position, Quaternion.identity);
Canbig = false;
StartCoroutine(DelayedSpread());
}
// 延迟蔓延
private IEnumerator DelayedSpread()
{
// 等待设定的延迟时间
yield return new WaitForSeconds(3);
// 开始蔓延火焰
SpreadFireInWindDirection();
}
//根据风向改变
private void SpreadFireInWindDirection()
{
if (SpreadFireNumber<=0)
{
return;
}
SpreadFireNumber--;
Vector3 spreadDirection = Vector3.zero;
// 根据风向设置火焰蔓延的方向
switch (windDirection)
{
case WindDirection.North:
spreadDirection = Vector3.forward;
break;
case WindDirection.South:
spreadDirection = Vector3.back;
break;
case WindDirection.East:
spreadDirection = Vector3.right;
break;
case WindDirection.West:
spreadDirection = Vector3.left;
break;
}
// 获取风向的目标位置
Vector3 targetPosition = transform.position + spreadDirection * spreadRadius;
// 在目标位置实例化新的pos
Instantiate(gameObject, targetPosition, Quaternion.identity);
// GameObject go = Instantiate(gameObject, targetPosition, Quaternion.identity);
//go.AddComponent<Firelive>();
}
}