Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions Assets/Scenes/RoboSub2019.unity
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!4 &31472223 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 8659837571720475807, guid: a3a0cca5d346f0840b5c29fe80612d07,
type: 3}
m_PrefabInstance: {fileID: 8659837570782410310}
m_PrefabAsset: {fileID: 0}
--- !u!4 &267303360 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 400002, guid: 4cdde95925ad7a842abe1dde8539354b,
Expand Down Expand Up @@ -212,6 +218,51 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 3705333200093046295}
m_PrefabAsset: {fileID: 0}
--- !u!1 &618658655
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 618658656}
- component: {fileID: 618658657}
m_Layer: 0
m_Name: Sonar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &618658656
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 618658655}
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_Children: []
m_Father: {fileID: 31472223}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &618658657
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 618658655}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8668489e9b544524db94ceab3bd9b027, type: 3}
m_Name:
m_EditorClassIdentifier:
viewRadious: 0
tasks: {fileID: 3705333199070647808}
--- !u!4 &770608637 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 400032, guid: 5f066c25dd1843b45b91b95fbc554ceb,
Expand Down Expand Up @@ -522,6 +573,27 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a5b50892273f3234fade02ce2357559c, type: 3}
m_Name:
m_EditorClassIdentifier:
objectBigSettings:
minRadius: 3
maxRadius: 8
waterLevel: 11
maxDepth: 4
othMaxDepth: 2
cameraFov: 40
objectSmallSettings:
minRadius: 1.5
maxRadius: 3
waterLevel: 9
maxDepth: 7.5
othMaxDepth: 3
cameraFov: 40
objectBottomSettings:
minRadius: 1.5
maxRadius: 4
waterLevel: 11
maxDepth: 9
othMaxDepth: 3
cameraFov: 40
objectSettings:
- target: {fileID: 4282235253200172265}
targetAnnotation: {fileID: 4282235253200172265}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions Assets/Scripts/Robot/functionality/Sonar.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;


namespace Robot
{
public class Sonar : MonoBehaviour
{

[SerializeField]
private float _viewRadious;
private string nameTasksObject = "TasksFolder";
private Dictionary<Transform, int> _objectsInSonarArea;

public Dictionary<Transform, int> objectsInSonarArea
{
get { return _objectsInSonarArea; }
}

public float viewRadious
{
get { return _viewRadious; }
}

private void Start()
{
Transform tasks = GameObject.FindWithTag(nameTasksObject).transform;
_objectsInSonarArea = new Dictionary<Transform, int>();



for (int ID = 0; ID < tasks.childCount; ID++)
{
_objectsInSonarArea.Add(tasks.GetChild(ID), 0);
}

}

void Update()
{

for (int i = 0; i < _objectsInSonarArea.Count; i++)
{

var element = _objectsInSonarArea.ElementAt(i);


if (Vector3.Distance(element.Key.position, transform.position) <= _viewRadious)
{
_objectsInSonarArea[element.Key] = 1;
}
else
{
_objectsInSonarArea[element.Key] = 0;
}

}

}
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/Robot/functionality/Sonar.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Logs/Packages-Update.log
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The following packages were updated:
com.unity.package-manager-ui from version 1.9.11 to 2.0.3
com.unity.textmeshpro from version 1.2.4 to 1.3.0

=== Tue Nov 12 19:10:36 2019
=== Fri Dec 6 16:57:51 2019

Packages were changed.
Update Mode: updateDependencies
Expand All @@ -35,3 +35,11 @@ The following packages were updated:
com.unity.package-manager-ui from version 2.0.3 to 2.2.0
com.unity.purchasing from version 2.0.3 to 2.0.6
com.unity.textmeshpro from version 1.3.0 to 2.0.1

=== Tue Jan 14 08:55:08 2020

Packages were changed.
Update Mode: updateDependencies

The following packages were updated:
com.unity.ide.vscode from version 1.1.2 to 1.1.3
2 changes: 1 addition & 1 deletion Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"com.unity.collab-proxy": "1.2.16",
"com.unity.ext.nunit": "1.0.0",
"com.unity.ide.rider": "1.1.0",
"com.unity.ide.vscode": "1.1.2",
"com.unity.ide.vscode": "1.1.3",
"com.unity.multiplayer-hlapi": "1.0.2",
"com.unity.package-manager-ui": "2.2.0",
"com.unity.purchasing": "2.0.6",
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2019.2.9f1
m_EditorVersionWithRevision: 2019.2.9f1 (ebce4d76e6e8)
m_EditorVersion: 2019.2.17f1
m_EditorVersionWithRevision: 2019.2.17f1 (8e603399ca02)