Skip to content

Commit

Permalink
More robust taking items from screen code. Now looks for a text file …
Browse files Browse the repository at this point in the history
…called "DontTrackList" and will not track any gameobjects that are named in that text file.
  • Loading branch information
brett-taylor committed Jan 4, 2019
1 parent 979f765 commit b97dd1b
Show file tree
Hide file tree
Showing 16 changed files with 160 additions and 83 deletions.
4 changes: 4 additions & 0 deletions DontTrackList - Example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
planterpot
planterbox
plantershelf
alongplanter
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!1 &1222060525602326
GameObject:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -467,7 +467,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1534684113904162}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: -0.5, z: 0}
m_LocalPosition: {x: 0, y: -0.5, z: 0.049}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4261509917996202}
Expand Down Expand Up @@ -569,7 +569,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.18382353, g: 0.18382353, b: 0.18382353, a: 1}
m_Color: {r: 0.18382353, g: 0.18382353, b: 0.18382353, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
Expand Down Expand Up @@ -1114,7 +1114,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ReferencePixelsPerUnit: 50
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
Expand Down Expand Up @@ -1315,7 +1315,7 @@ RectTransform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1659912519055400}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.015}
m_LocalPosition: {x: 0, y: 0, z: 0.063999996}
m_LocalScale: {x: -0.0009234928, y: 0.0010885138, z: 1.3644528}
m_Children:
- {fileID: 224340271212837900}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ManifestFileVersion: 0
CRC: 3554606922
CRC: 2170159394
AssetBundleManifest:
AssetBundleInfos:
Info_0:
Expand Down
Binary file modified ResourceMonitor Unity Project/Built Asset Bundles/resources
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ManifestFileVersion: 0
CRC: 644164568
CRC: 3116201863
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: 28d6eaac1d1aea8f5217f72285da92f1
Hash: b3f9ac2f149687dfd441e044b658aeed
TypeTreeHash:
serializedVersion: 2
Hash: cd706fa7e487f229c6b1a506387ac5ed
Expand Down
62 changes: 31 additions & 31 deletions ResourceMonitor Unity Project/Library/CurrentLayout.dwlt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MonoBehaviour:
m_ShowMode: 4
m_Title:
m_RootView: {fileID: 6}
m_MinSize: {x: 950, y: 371}
m_MinSize: {x: 950, y: 300}
m_MaxSize: {x: 10000, y: 10000}
--- !u!114 &2
MonoBehaviour:
Expand All @@ -42,8 +42,8 @@ MonoBehaviour:
y: 30
width: 1920
height: 947
m_MinSize: {x: 681, y: 321}
m_MaxSize: {x: 12006, y: 8021}
m_MinSize: {x: 683, y: 492}
m_MaxSize: {x: 14004, y: 14042}
vertical: 0
controlID: 49
--- !u!114 &3
Expand Down Expand Up @@ -89,8 +89,8 @@ MonoBehaviour:
y: 0
width: 284
height: 655
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 16}
m_Panes:
- {fileID: 16}
Expand All @@ -114,15 +114,15 @@ MonoBehaviour:
y: 655
width: 1594
height: 292
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 13}
m_MinSize: {x: 232, y: 271}
m_MaxSize: {x: 10002, y: 10021}
m_ActualView: {fileID: 14}
m_Panes:
- {fileID: 14}
- {fileID: 19}
- {fileID: 13}
m_Selected: 2
m_LastSelected: 0
m_Selected: 0
m_LastSelected: 2
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
Expand Down Expand Up @@ -207,8 +207,8 @@ MonoBehaviour:
y: 0
width: 1594
height: 947
m_MinSize: {x: 406, y: 321}
m_MaxSize: {x: 8006, y: 8021}
m_MinSize: {x: 406, y: 492}
m_MaxSize: {x: 10002, y: 14042}
vertical: 1
controlID: 50
--- !u!114 &10
Expand Down Expand Up @@ -253,8 +253,8 @@ MonoBehaviour:
y: 0
width: 1310
height: 655
m_MinSize: {x: 204, y: 221}
m_MaxSize: {x: 4004, y: 4021}
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 17}
m_Panes:
- {fileID: 17}
Expand Down Expand Up @@ -372,18 +372,18 @@ MonoBehaviour:
m_ShowAllHits: 0
m_SearchArea: 0
m_Folders:
- Assets
- Assets/prefabs
m_ViewMode: 1
m_StartGridSize: 70
m_LastFolders:
- Assets
- Assets/prefabs
m_LastFoldersGridSize: 70
m_LastProjectPath: D:\Subnatuic Modding\ResourceMonitor\ResourceMonitor Unity Project
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 26270000
m_LastClickedID: 10022
m_SelectedIDs: 74270000
m_LastClickedID: 10100
m_ExpandedIDs: 000000002627000000ca9a3bffffff7f
m_RenameOverlay:
m_UserAcceptedRename: 0
Expand Down Expand Up @@ -437,8 +437,8 @@ MonoBehaviour:
m_Icon: {fileID: 0}
m_ResourceFile:
m_ListAreaState:
m_SelectedInstanceIDs: 6413feff
m_LastClickedInstanceID: -126108
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 1
m_ExpandedInstanceIDs: c62300005a1400007017000078170000f00d0000e262ffff3e28000000000000
m_RenameOverlay:
Expand Down Expand Up @@ -528,23 +528,23 @@ MonoBehaviour:
height: 634
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 6413feff
m_LastClickedID: -126108
m_ExpandedIDs: 3601feff6813feff60f4ffff4efbffff80fbffffa0fbffffa4fbffffa6fbffff00000000
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 48fbffff5afbffff80fbffffa0fbffffa4fbffffa6fbffff00000000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name: IdleScreen
m_OriginalName: IdleScreen
m_Name:
m_OriginalName:
m_EditFieldRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_UserData: -126108
m_UserData: 0
m_IsWaitingForDelay: 0
m_IsRenaming: 0
m_OriginalEventType: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 0
m_ClientGUIView: {fileID: 4}
m_SearchString:
Expand Down Expand Up @@ -585,9 +585,9 @@ MonoBehaviour:
m_isRotationLocked: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: -0.009873722, y: -0.08379525, z: -0.3697785}
m_Target: {x: -0.036659535, y: 0.04360065, z: 0.29956484}
speed: 2
m_Value: {x: -0.009873722, y: -0.08379525, z: -0.3697785}
m_Value: {x: -0.036659535, y: 0.04360065, z: 0.29956484}
m_RenderMode: 0
m_ValidateTrueMetals: 0
m_SceneViewState:
Expand All @@ -610,9 +610,9 @@ MonoBehaviour:
speed: 2
m_Value: 0
m_Rotation:
m_Target: {x: -0.0008759998, y: 0.99546325, z: -0.09469282, w: -0.009244689}
m_Target: {x: 0.00056211103, y: 0.9952013, z: -0.09768218, w: 0.0056855464}
speed: 2
m_Value: {x: -0.0008759998, y: 0.99546325, z: -0.09469282, w: -0.009244689}
m_Value: {x: 0.00056211103, y: 0.9952013, z: -0.09768218, w: 0.0056855464}
m_Size:
m_Target: 1.1984951
speed: 2
Expand Down
Binary file modified ResourceMonitor Unity Project/Library/LastBuild.buildreport
Binary file not shown.
Binary file modified ResourceMonitor Unity Project/Library/assetDatabase3
Binary file not shown.
2 changes: 1 addition & 1 deletion ResourceMonitor/Components/ItemButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public TechType Type
{
set
{
TextLineOne = TechTypeExtensions.Get(Language.main, value);
TextLineOne = "Take " + TechTypeExtensions.Get(Language.main, value);
type = value;
}

Expand Down
18 changes: 17 additions & 1 deletion ResourceMonitor/Components/OnScreenButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,32 @@ public abstract class OnScreenButton : MonoBehaviour
protected bool IsHovered { get; set; }
protected string TextLineOne { get; set; }
protected string TextLineTwo { get; set; }
private bool isHoveredOutOfRange;

public virtual void OnDisable()
{
IsHovered = false;
isHoveredOutOfRange = false;
}

public virtual void Update()
{
if (IsHovered && InInteractionRange())
bool inInteractionRange = InInteractionRange();

if (IsHovered && inInteractionRange)
{
HandReticle.main.SetInteractTextRaw(TextLineOne, TextLineTwo);
}

if (IsHovered && inInteractionRange == false)
{
IsHovered = false;
}

if (IsHovered == false && isHoveredOutOfRange && inInteractionRange)
{
IsHovered = true;
}
}

public virtual void OnPointerEnter(PointerEventData eventData)
Expand All @@ -33,12 +47,14 @@ public virtual void OnPointerEnter(PointerEventData eventData)
IsHovered = true;
}

isHoveredOutOfRange = true;
ResourceMonitorDisplay.ResetIdleTimer();
}

public virtual void OnPointerExit(PointerEventData eventData)
{
IsHovered = false;
isHoveredOutOfRange = false;
ResourceMonitorDisplay.ResetIdleTimer();
}

Expand Down
2 changes: 1 addition & 1 deletion ResourceMonitor/Components/PaginatorButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public void OnEnable()

public override void OnDisable()
{
base.OnDisable();
if (text != null)
{
text.color = STARTING_COLOR;
}
base.OnDisable();
}

public override void OnPointerEnter(PointerEventData eventData)
Expand Down
Loading

0 comments on commit b97dd1b

Please sign in to comment.