浏览代码

Added FallCatcher script for water areas

/main
Ciro Continisio 3 年前
当前提交
1d3f0c8a
共有 6 个文件被更改,包括 60 次插入3 次删除
  1. 5
      UOP1_Project/Assets/Scripts/Characters/Damageable.cs
  2. 4
      UOP1_Project/Assets/Scripts/SceneManagement/LocationExit.cs
  3. 14
      UOP1_Project/Assets/ScriptableObjects/Paths/TownMarket_LakeFall.asset
  4. 8
      UOP1_Project/Assets/ScriptableObjects/Paths/TownMarket_LakeFall.asset.meta
  5. 19
      UOP1_Project/Assets/Scripts/SceneManagement/FallCatcher.cs
  6. 13
      UOP1_Project/Assets/Scripts/SceneManagement/FallCatcher.cs.meta

5
UOP1_Project/Assets/Scripts/Characters/Damageable.cs


_currentHealth = _healthConfigSO.MaxHealth;
}
public void Kill()
{
ReceiveAnAttack(_currentHealth);
}
public void ReceiveAnAttack(int damage)
{
if (IsDead)

4
UOP1_Project/Assets/Scripts/SceneManagement/LocationExit.cs


{
if (other.CompareTag("Player"))
{
if (_pathStorage != null)
_pathStorage.lastPathTaken = _leadsToPath;
_pathStorage.lastPathTaken = _leadsToPath;
_locationExitLoadChannel.RaiseEvent(_locationToLoad, false, true);
}
}

14
UOP1_Project/Assets/ScriptableObjects/Paths/TownMarket_LakeFall.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
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: fedb6eda6181441209c70ac00d6e7cc8, type: 3}
m_Name: TownMarket_LakeFall
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Paths/TownMarket_LakeFall.asset.meta


fileFormatVersion: 2
guid: 1a2c4047212a5db44831cf5fb63d18d8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

19
UOP1_Project/Assets/Scripts/SceneManagement/FallCatcher.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FallCatcher : MonoBehaviour
{
[SerializeField] private PathSO _leadsToPath = default;
[SerializeField] private PathStorageSO _pathStorage = default;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
_pathStorage.lastPathTaken = _leadsToPath;
other.GetComponent<Damageable>().Kill();
}
}
}

13
UOP1_Project/Assets/Scripts/SceneManagement/FallCatcher.cs.meta


fileFormatVersion: 2
guid: 7b40d4330999a9f4b99b6f67e3e50055
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- _leadsToPath: {instanceID: 0}
- _pathStorage: {fileID: 11400000, guid: a9ec09853cba047a8a58f5881053cfc6, type: 2}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存