diff --git a/theProject/Assets/Prefabs/Soldier.prefab b/theProject/Assets/Prefabs/Soldier.prefab index ec0e2ef3..8fe69179 100644 --- a/theProject/Assets/Prefabs/Soldier.prefab +++ b/theProject/Assets/Prefabs/Soldier.prefab @@ -9,9 +9,9 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 430939372503899243} - - component: {fileID: 2567001691605468863} - component: {fileID: 9215955991629613539} - component: {fileID: 1033819704020761458} + - component: {fileID: 7079878905123983671} m_Layer: 0 m_Name: Soldier m_TagString: 'Ally ' @@ -37,19 +37,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} ---- !u!65 &2567001691605468863 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 403095692180922766} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} --- !u!54 &9215955991629613539 Rigidbody: m_ObjectHideFlags: 0 @@ -97,6 +84,18 @@ MonoBehaviour: enemyType: 0 movementDestination: {x: 0, y: 0} hasReachedDestination: 1 +--- !u!114 &7079878905123983671 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 403095692180922766} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 531947a4f2c9d414880a0f04ecd2c970, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1997457243244158843 GameObject: m_ObjectHideFlags: 0 diff --git a/theProject/Assets/Scripts/Entities/Communication.cs b/theProject/Assets/Scripts/Entities/Communication.cs index 98f4c6e2..3d32f88c 100644 --- a/theProject/Assets/Scripts/Entities/Communication.cs +++ b/theProject/Assets/Scripts/Entities/Communication.cs @@ -4,5 +4,47 @@ using UnityEngine; public class Communication : MonoBehaviour { + public struct CommunicationResult + { + public bool resetTTL; + public List enemiesSpotted; + } + private float viewRange = 5f; + private Soldier mySoldier = null; + private Entity.Team myTeam = Entity.Team.Ally; + + // ---------- public methods + + public void Initialize(float _viewRange, Soldier _mySoldier, Entity.Team _myTeam) + { + viewRange = _viewRange; + mySoldier = _mySoldier; + myTeam = _myTeam; + } + + public CommunicationResult HandleCommuncation() + { + CommunicationResult result = new CommunicationResult(); + result.resetTTL = false; + result.enemiesSpotted = new List(); + + // look for soldiers in vincinity + + // send Keep Alive (myTeam) - reset TTL (myTTL) + + // look fo enemies (enemyTeam) - add Enemies to enemiesSpotted (send List) + + return result; + } + + // ---------- private methods + + private Soldier[] GetSoldiersInVincinity() + { + //TO DO - implement + Physics.SphereCastAll() + + return null; + } }