-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
324 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
namespace Harion.Data { | ||
public class GroundData { | ||
|
||
public Vector2 OriginalPosition { get; } = new Vector2(); | ||
public float OriginalRadius { get; } = 1f; | ||
public int NummberOfCloestElement { get; internal set; } = 0; | ||
public List<Collider2D> GameObjectsFounds { get; internal set; } = new(); | ||
public bool GroundIsFound { get; internal set; } = false; | ||
public GameObject Ground { get; internal set; } | ||
|
||
public GroundData(Vector2 originalPosition, float originalRadius) { | ||
OriginalPosition = originalPosition; | ||
OriginalRadius = originalRadius; | ||
} | ||
|
||
public static GroundData GroundIsNearest(Vector2 Position, float radius) { | ||
GroundData groundData = new GroundData(Position, radius); | ||
GameObject ground = null; | ||
|
||
List<Collider2D> GameObjects = Physics2D.OverlapCircleAll(Position, radius).ToList(); | ||
groundData.GameObjectsFounds = GameObjects; | ||
if (GameObjects.Count > 0) { | ||
groundData.NummberOfCloestElement = GameObjects.Count; | ||
foreach (Collider2D collider in GameObjects) { | ||
GameObject go = collider.gameObject; | ||
if (go.name == "Ground") { | ||
groundData.Ground = go; | ||
ground = go; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
groundData.GroundIsFound = ground != null; | ||
return groundData; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
namespace Harion.Enumerations { | ||
public enum MapType | ||
{ | ||
public enum MapType { | ||
Skeld = 0, | ||
MiraHQ = 1, | ||
Polus = 2, | ||
Airship = 3, // Just guessing | ||
Dlesk = 3, | ||
Airship = 4 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!1 &5364299042878532103 | ||
GameObject: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
serializedVersion: 6 | ||
m_Component: | ||
- component: {fileID: 3460033891019039650} | ||
- component: {fileID: 3258885039038995231} | ||
m_Layer: 0 | ||
m_Name: NavigationMesh | ||
m_TagString: Untagged | ||
m_Icon: {fileID: 0} | ||
m_NavMeshLayer: 0 | ||
m_StaticEditorFlags: 0 | ||
m_IsActive: 1 | ||
--- !u!4 &3460033891019039650 | ||
Transform: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 5364299042878532103} | ||
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: 0} | ||
m_RootOrder: 0 | ||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
--- !u!195 &3258885039038995231 | ||
NavMeshAgent: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 5364299042878532103} | ||
m_Enabled: 1 | ||
m_AgentTypeID: 0 | ||
m_Radius: 0.5 | ||
m_Speed: 3.5 | ||
m_Acceleration: 8 | ||
avoidancePriority: 50 | ||
m_AngularSpeed: 120 | ||
m_StoppingDistance: 0.1 | ||
m_AutoTraverseOffMeshLink: 1 | ||
m_AutoBraking: 1 | ||
m_AutoRepath: 1 | ||
m_Height: 0.2 | ||
m_BaseOffset: 0 | ||
m_WalkableMask: 4294967295 | ||
m_ObstacleAvoidanceType: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.