diff --git a/Assets/Prefabs/Planet.prefab b/Assets/Prefabs/Planet.prefab index 5db842a..f7b3a70 100644 --- a/Assets/Prefabs/Planet.prefab +++ b/Assets/Prefabs/Planet.prefab @@ -23,12 +23,13 @@ GameObject: - component: {fileID: 135109188371165034} - component: {fileID: 23372130855063780} - component: {fileID: 114326536889039870} + - component: {fileID: 122108660053095858} m_Layer: 0 m_Name: Planet m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 + m_StaticEditorFlags: 1 m_IsActive: 1 --- !u!4 &4818314637430640 Transform: @@ -37,7 +38,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1226159707423718} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 50} m_LocalScale: {x: 15, y: 15, z: 15} m_Children: [] m_Father: {fileID: 0} @@ -93,6 +94,18 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e25732012cad4e3aa59a8cf2f78581b5, type: 3} m_Name: m_EditorClassIdentifier: + halo: {fileID: 122108660053095858} +--- !u!122 &122108660053095858 +Halo: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1226159707423718} + m_Enabled: 1 + m_Color: + serializedVersion: 2 + rgba: 4294967295 + m_Size: 10 --- !u!135 &135109188371165034 SphereCollider: m_ObjectHideFlags: 1 diff --git a/Assets/Scripts/Planet.cs b/Assets/Scripts/Planet.cs index 1317104..c3d44c4 100644 --- a/Assets/Scripts/Planet.cs +++ b/Assets/Scripts/Planet.cs @@ -3,10 +3,14 @@ public class Planet : MonoBehaviour { + // used for highlighting a planet + public Behaviour halo; + [Inject] public void Construct(Vector3 position) { transform.position = getPlanetPosition(position); + halo.enabled = false; } public class Factory : Factory @@ -21,4 +25,14 @@ private Vector3 getPlanetPosition(Vector3 relativePosition) return new Vector3(relativePosition.x + x, relativePosition.y + y, relativePosition.z + z); } + + public void OnMouseEnter() + { + halo.enabled = true; + } + + private void OnMouseExit() + { + halo.enabled = false; + } } \ No newline at end of file