Changed namespaces
This commit is contained in:
parent
1bb9d584dd
commit
0a67caf9be
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -7,7 +7,8 @@
|
|||
"GUID:f008ecc6829887e478aeb5eb004eb01b",
|
||||
"GUID:17a5862fcd6383b4b97bad4dcb1e2e5d",
|
||||
"GUID:f26d68a0bdefa1043b120b820f55e190",
|
||||
"GUID:eb3099ff524d60545a136315a154d67b"
|
||||
"GUID:eb3099ff524d60545a136315a154d67b",
|
||||
"GUID:5d38ea13ae8f69a4395d425d401a557a"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit f2355fc7825d8f09a407b31aaa4178b6fbdd3406
|
||||
Subproject commit c473d58817fa7c0cdd6d6f488cf6c8b9ffd5c52e
|
|
@ -23,6 +23,7 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 631532845000205954}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
|
@ -32,7 +33,6 @@ Transform:
|
|||
- {fileID: 91949040360545666}
|
||||
- {fileID: 8001059947964412310}
|
||||
m_Father: {fileID: 7780103704517281592}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &700493555145955010
|
||||
GameObject:
|
||||
|
@ -57,6 +57,7 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 700493555145955010}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
|
@ -65,8 +66,54 @@ Transform:
|
|||
- {fileID: 1671077540319194627}
|
||||
- {fileID: 3955427233603104958}
|
||||
m_Father: {fileID: 3291032053430181389}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1312307913408260796
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4626427865743511805}
|
||||
- component: {fileID: 4299120351774448665}
|
||||
m_Layer: 0
|
||||
m_Name: Damageable
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4626427865743511805
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1312307913408260796}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5123077350175375293}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &4299120351774448665
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1312307913408260796}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a845ca774f1a2d341b32451b100c0d1c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
<CurrentHealth>k__BackingField: 0
|
||||
<MaxHealth>k__BackingField: 0
|
||||
<IsInvulnerable>k__BackingField: 0
|
||||
--- !u!1 &1856154329861502355
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -92,13 +139,13 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1856154329861502355}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0.341, y: 0, z: 0.587}
|
||||
m_LocalScale: {x: 0.24, y: 0.4597677, z: 0.19977282}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5355765884551595638}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90}
|
||||
--- !u!33 &4938033185760690219
|
||||
MeshFilter:
|
||||
|
@ -150,6 +197,39 @@ MeshRenderer:
|
|||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &1900887375425358919
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5123077350175375293}
|
||||
m_Layer: 0
|
||||
m_Name: Functions
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5123077350175375293
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1900887375425358919}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4626427865743511805}
|
||||
- {fileID: 3486364872742429245}
|
||||
m_Father: {fileID: 2692714622321691895}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &3867128990362458971
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -175,13 +255,13 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3867128990362458971}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0.536, y: 0.206, z: -0.193}
|
||||
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 91949040360545666}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &8811483340839899384
|
||||
MeshFilter:
|
||||
|
@ -257,13 +337,13 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4192276824634724634}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3291032053430181389}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!65 &5604178963170827772
|
||||
BoxCollider:
|
||||
|
@ -273,9 +353,17 @@ BoxCollider:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4192276824634724634}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 1.3168308, y: 1, z: 1.3902934}
|
||||
m_Center: {x: 0.15841538, y: 0, z: -0.0017904043}
|
||||
--- !u!1 &4921375452445824178
|
||||
|
@ -303,13 +391,13 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4921375452445824178}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0.536, y: 0.206, z: 0.205}
|
||||
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 91949040360545666}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &274824493129163367
|
||||
MeshFilter:
|
||||
|
@ -361,6 +449,53 @@ MeshRenderer:
|
|||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &5367121395816538489
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3486364872742429245}
|
||||
- component: {fileID: 4691274110434226497}
|
||||
m_Layer: 0
|
||||
m_Name: Targetable
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3486364872742429245
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5367121395816538489}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5123077350175375293}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &4691274110434226497
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5367121395816538489}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a845ca774f1a2d341b32451b100c0d1c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
<CurrentHealth>k__BackingField: 0
|
||||
<MaxHealth>k__BackingField: 0
|
||||
<IsInvulnerable>k__BackingField: 0
|
||||
--- !u!1 &5599539567497807159
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -385,14 +520,15 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5599539567497807159}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 191376514769192977}
|
||||
- {fileID: 5123077350175375293}
|
||||
- {fileID: 4114072049224310043}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1411216412654489461
|
||||
MonoBehaviour:
|
||||
|
@ -418,6 +554,38 @@ MonoBehaviour:
|
|||
_targeter: {fileID: 0}
|
||||
_target: {fileID: 0}
|
||||
_navMeshAgent: {fileID: 0}
|
||||
--- !u!1 &6015068770338930083
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4114072049224310043}
|
||||
m_Layer: 0
|
||||
m_Name: Rig
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4114072049224310043
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6015068770338930083}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 191376514769192977}
|
||||
m_Father: {fileID: 2692714622321691895}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &6940800288144322101
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -441,14 +609,14 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6940800288144322101}
|
||||
m_LocalRotation: {x: 0, y: -0.7071068, z: 0, w: 0.7071068}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0.7071068, z: -0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 2.01, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 7780103704517281592}
|
||||
m_Father: {fileID: 2692714622321691895}
|
||||
m_RootOrder: 0
|
||||
m_Father: {fileID: 4114072049224310043}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &7089677990206923544
|
||||
GameObject:
|
||||
|
@ -473,6 +641,7 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7089677990206923544}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
|
@ -480,7 +649,6 @@ Transform:
|
|||
m_Children:
|
||||
- {fileID: 3291032053430181389}
|
||||
m_Father: {fileID: 191376514769192977}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &8831453991117079309
|
||||
GameObject:
|
||||
|
@ -507,6 +675,7 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8831453991117079309}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
|
@ -515,7 +684,6 @@ Transform:
|
|||
- {fileID: 7956298909069556562}
|
||||
- {fileID: 4518982824339893338}
|
||||
m_Father: {fileID: 3291032053430181389}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &5128498621595353232
|
||||
MeshFilter:
|
||||
|
@ -592,13 +760,13 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8931538593362537433}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0.34100002, y: 0, z: -0.603}
|
||||
m_LocalScale: {x: 0.24, y: 0.4597677, z: 0.19977282}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5355765884551595638}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90}
|
||||
--- !u!33 &6582230243926515993
|
||||
MeshFilter:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
|
@ -8,19 +9,21 @@ namespace AsteroidGame.Entities
|
|||
{
|
||||
[SerializeField] private SoEntityBaseRuntimeSet _enemyBaseSet;
|
||||
|
||||
[Header("Targeter")]
|
||||
[SerializeField] private Targeter _targeter;
|
||||
[SerializeField] private EntityBase _target;
|
||||
|
||||
[Header("NavMeshAgent")]
|
||||
[field: Header("Targeter")]
|
||||
[SerializeField] private SoTargeterConfig _targeterConfig;
|
||||
[field: SerializeField] public Targeter Targeter { get; set; }
|
||||
|
||||
[field: Header("NavMeshAgent")]
|
||||
[SerializeField] private NavMeshAgent _navMeshAgent;
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
|
||||
_enemyBaseSet.Add(this);
|
||||
|
||||
InitializeTargeter();
|
||||
|
||||
InitializeNavMeshAgent();
|
||||
}
|
||||
|
||||
|
@ -32,9 +35,9 @@ namespace AsteroidGame.Entities
|
|||
|
||||
private void InitializeTargeter()
|
||||
{
|
||||
_targeter = gameObject.AddComponent<Targeter>();
|
||||
_targeter.SetParent(this);
|
||||
_targeter.SetConfig(_targeterConfig);
|
||||
Targeter = gameObject.AddComponent<Targeter>();
|
||||
Targeter.SetParent(this);
|
||||
Targeter.SetConfig(_targeterConfig);
|
||||
}
|
||||
|
||||
protected override void OnDisable()
|
||||
|
@ -45,11 +48,10 @@ namespace AsteroidGame.Entities
|
|||
|
||||
private void Update()
|
||||
{
|
||||
if (_targeter.FoundTarget())
|
||||
{
|
||||
_target = _targeter.GetTarget();
|
||||
if (!Targeter.FoundTarget()) return;
|
||||
|
||||
Target = Targeter.GetTarget();
|
||||
_navMeshAgent.SetDestination(_target.GetBasePosition());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,8 +2,6 @@
|
|||
"name": "Entities",
|
||||
"rootNamespace": "AsteroidGame",
|
||||
"references": [
|
||||
"GUID:17a5862fcd6383b4b97bad4dcb1e2e5d",
|
||||
"GUID:eb3099ff524d60545a136315a154d67b",
|
||||
"GUID:5d38ea13ae8f69a4395d425d401a557a"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
%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: 0}
|
||||
m_Name: newEnemyBaseRuntimeSet
|
||||
m_EditorClassIdentifier:
|
||||
_list: []
|
|
@ -1,7 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eb3099ff524d60545a136315a154d67b
|
||||
AssemblyDefinitionImporter:
|
||||
guid: d681acab3b5d24f458e9c1c281d375cb
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,8 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using AsteroidGame.Entities.Enemies.Scripts;
|
||||
using AsteroidGame.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newEnemyList", menuName = "Enemies/EnemyList")]
|
||||
public class SoEnemyBaseList : ScriptableObject
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using AsteroidGame.Entities.Enemies.Scripts;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using AsteroidGame.Entities;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newEnemyBaseRuntimeSet", menuName = "RuntimeSet/EnemyBase")]
|
||||
public class SoEnemyBaseRuntimeSet : SRuntimeSet<EnemyBase>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using AsteroidGame.ScriptableObjects;
|
||||
using AsteroidGame.Entities;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newEntityBaseRuntimeSet", menuName = "RuntimeSet/EntityBase")]
|
||||
public class SoEntityBaseRuntimeSet : SRuntimeSet<EntityBase>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using AsteroidGame.ScriptableObjects;
|
||||
using AsteroidGame.Entities;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newPowerBaseRuntimeSet", menuName = "RuntimeSet/PowerBase")]
|
||||
public class SoPowerBaseRuntimeSet : SRuntimeSet<PowerBase>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newPowerConfiguration", menuName = "Configuration/Power")]
|
||||
public class SoPowerConfig : ScriptableObject
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using AsteroidGame.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newStructureList", menuName = "Structures/StructureList")]
|
||||
public class SoStructureBaseList : ScriptableObject
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using AsteroidGame.ScriptableObjects;
|
||||
using AsteroidGame.Entities;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newStructureBaseRuntimeSet", menuName = "RuntimeSet/StructureBase")]
|
||||
public class SoStructureBaseRuntimeSet : SRuntimeSet<StructureBase>
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newTargeterConfiguration", menuName = "Configuration/Targeter")]
|
||||
public class SoTargeterConfig : ScriptableObject
|
||||
{
|
||||
public float _range;
|
||||
public TargetStrategy _selectedTargetStrategy;
|
||||
public SoEntityBaseRuntimeSet _activeEntities;
|
||||
public SoTargetableRuntimeSet _activeEntities;
|
||||
|
||||
public enum TargetStrategy
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using AsteroidGame.CoreSystems;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
public class SoWeaponConfig : ScriptableObject, IWeapon
|
||||
{
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
using AsteroidGame.Interfaces;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
{
|
||||
public class EntityBase : MonoBehaviour, IDamageable, ITargetable
|
||||
public class EntityBase : MonoBehaviour
|
||||
{
|
||||
[Header("Health")]
|
||||
[SerializeField] protected int _health;
|
||||
[SerializeField] protected int _maxHealth;
|
||||
[SerializeField] protected bool _isInvulnerable;
|
||||
[field: Header("Damageable")]
|
||||
[field: SerializeField] public Damageable Damageable { get; set; }
|
||||
|
||||
[Header("TargetPositions")]
|
||||
[SerializeField] private Transform _centerPosition;
|
||||
[SerializeField] private Transform _basePosition;
|
||||
[field: Header("Targetable")]
|
||||
[field: SerializeField] public Targetable Targetable { get; set; }
|
||||
|
||||
[Header("UI")]
|
||||
[SerializeField] protected string _uiFriendlyName;
|
||||
|
@ -22,7 +20,6 @@ namespace AsteroidGame.Entities
|
|||
|
||||
#region Props
|
||||
|
||||
public bool IsInvulnerable => _isInvulnerable;
|
||||
public string UiFriendlyName => _uiFriendlyName;
|
||||
|
||||
#endregion
|
||||
|
@ -30,6 +27,10 @@ namespace AsteroidGame.Entities
|
|||
protected virtual void OnEnable()
|
||||
{
|
||||
_entityBaseSet.Add(this);
|
||||
|
||||
InitializeDamageable();
|
||||
|
||||
InitializeTargetable();
|
||||
}
|
||||
|
||||
protected virtual void OnDisable()
|
||||
|
@ -37,40 +38,14 @@ namespace AsteroidGame.Entities
|
|||
_entityBaseSet.Remove(this);
|
||||
}
|
||||
|
||||
#region Methods
|
||||
|
||||
public void ModifyHealth(int healthChange)
|
||||
private void InitializeTargetable()
|
||||
{
|
||||
if (!_isInvulnerable)
|
||||
Targetable = gameObject.AddComponent<Targetable>();
|
||||
}
|
||||
|
||||
private void InitializeDamageable()
|
||||
{
|
||||
_health += healthChange;
|
||||
Damageable = gameObject.AddComponent<Damageable>();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Setters
|
||||
|
||||
public void SetHealth(int newHealth) => _health = newHealth;
|
||||
|
||||
public void SetMaxHealth(int newHealth) => _maxHealth = newHealth;
|
||||
|
||||
public void SetInvulnerable(bool newState) => _isInvulnerable = newState;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Getters
|
||||
|
||||
public Vector3 GetCenterPosition() => _centerPosition.transform.position;
|
||||
|
||||
public Vector3 GetBasePosition() => _basePosition.transform.position;
|
||||
|
||||
public int GetHealth() => _health;
|
||||
|
||||
public int GetMaxHealth() => _maxHealth;
|
||||
|
||||
public float GetHealthFactor() => (float)_health / (float)_maxHealth;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using AsteroidGame.Interfaces;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
using AsteroidGame.ScriptableObjects;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
|
@ -5,12 +7,12 @@ namespace AsteroidGame.Entities
|
|||
public class Targeter : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private float _range;
|
||||
[SerializeField] private EntityBase _targeterParent;
|
||||
[SerializeField] private EntityBase _targetEntity;
|
||||
[SerializeField] private SoTargeterConfig.TargetStrategy _targetStrategy;
|
||||
[SerializeField] private SoEntityBaseRuntimeSet _activeEntities;
|
||||
[SerializeField] private SoTargetableRuntimeSet _activeEntities;
|
||||
[SerializeField] private Targetable _targeterParent;
|
||||
[SerializeField] private Targetable _targetEntity;
|
||||
|
||||
public void SetParent(EntityBase newParent) => _targeterParent = newParent;
|
||||
public void SetParent(Transform newParent) => _targeterParent.transform.parent = newParent;
|
||||
|
||||
public void SetConfig(SoTargeterConfig config)
|
||||
{
|
||||
|
@ -19,7 +21,7 @@ namespace AsteroidGame.Entities
|
|||
_activeEntities = config._activeEntities;
|
||||
}
|
||||
|
||||
public EntityBase GetTarget()
|
||||
public Targetable GetTarget()
|
||||
{
|
||||
return _targetEntity;
|
||||
}
|
||||
|
@ -29,7 +31,7 @@ namespace AsteroidGame.Entities
|
|||
float currentBestValue = Mathf.Infinity;
|
||||
var targetFound = false;
|
||||
|
||||
foreach (EntityBase targetEntity in _activeEntities._list)
|
||||
foreach (var targetEntity in _activeEntities._list)
|
||||
{
|
||||
float distanceToTarget =
|
||||
Vector3.Magnitude(targetEntity.GetCenterPosition() - _targeterParent.GetCenterPosition());
|
||||
|
@ -53,7 +55,8 @@ namespace AsteroidGame.Entities
|
|||
}
|
||||
case SoTargeterConfig.TargetStrategy.LowestHealth:
|
||||
{
|
||||
float enemyHealth = targetEntity.GetHealth();
|
||||
float enemyHealth = targetEntity.transform.parent.GetComponent<Damageable>()
|
||||
.GetCurrentHealth();
|
||||
|
||||
bool isLowestHealth = enemyHealth < currentBestValue;
|
||||
if (isLowestHealth)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using AsteroidGame.ScriptableObjects;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using AsteroidGame.Interfaces;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using AsteroidGame.Entities.Enemies.Scripts;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using GameDev.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
|
@ -22,7 +22,7 @@ namespace AsteroidGame.Entities
|
|||
[Header("Targeter")]
|
||||
[SerializeField] private SoTargeterConfig _targeterConfig;
|
||||
[SerializeField] private Targeter _targeter;
|
||||
[SerializeField] private EntityBase _target;
|
||||
[SerializeField] private Targetable _target;
|
||||
|
||||
#region Publics
|
||||
|
||||
|
@ -43,17 +43,16 @@ namespace AsteroidGame.Entities
|
|||
private void InitializeTargeter()
|
||||
{
|
||||
_targeter = gameObject.AddComponent<Targeter>();
|
||||
_targeter.SetParent(this);
|
||||
//_targeter.SetParent(this);
|
||||
_targeter.SetConfig(_targeterConfig);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_targeter.FoundTarget())
|
||||
{
|
||||
if (!_targeter.FoundTarget()) return;
|
||||
|
||||
_target = _targeter.GetTarget();
|
||||
_turretHead.transform.LookAt(_target.GetCenterPosition());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using AsteroidGame.Entities;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.Serialization;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using AsteroidGame.Entities;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Handlers
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using AsteroidGame.Entities;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Handlers
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4b8bc87700fc5a44b88c1b13c4bdb3cf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,20 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.ScriptableObjects
|
||||
{
|
||||
public abstract class SRuntimeSet<T> : ScriptableObject
|
||||
{
|
||||
public List<T> _list;
|
||||
|
||||
public void Add(T component)
|
||||
{
|
||||
_list.Add(component);
|
||||
}
|
||||
|
||||
public void Remove(T component)
|
||||
{
|
||||
_list.Remove(component);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1e81b384c7f010b4fa3c1b8f293a4c42
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"name": "ScriptableObjects",
|
||||
"rootNamespace": "AsteroidGame",
|
||||
"references": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
using InputSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ using AsteroidGame.Entities;
|
|||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using AsteroidGame.Handlers;
|
||||
using AsteroidGame.ScriptableObjects;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace AsteroidGame.UI
|
||||
|
|
|
@ -136,8 +136,7 @@ PlayerSettings:
|
|||
vulkanEnableCommandBufferRecycling: 1
|
||||
loadStoreDebugModeEnabled: 0
|
||||
bundleVersion: 0.1
|
||||
preloadedAssets:
|
||||
- {fileID: 11400000, guid: 2f27ffbbbd54d9c4b9435071982af520, type: 2}
|
||||
preloadedAssets: []
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
|
|
Loading…
Reference in New Issue