-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🕸 Finish UI for resource/inventory, slight problem with minimap (see #7
#8 )
- Loading branch information
1 parent
c94f130
commit 0caf6d1
Showing
1,013 changed files
with
212,836 additions
and
3,911 deletions.
There are no files selected for viewing
6,508 changes: 5,326 additions & 1,182 deletions
6,508
Alien World/Assets/Character Rigging/3D Character.unity
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Alien World/Assets/Resource Management.meta → Alien World/Assets/Gizmos/PivecLabs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Alien World/Assets/Gizmos/PivecLabs/UIComponents/Actions.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Alien World/Assets/Gizmos/PivecLabs/UIComponents/Actions/Canvas.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
164 changes: 164 additions & 0 deletions
164
Alien World/Assets/Gizmos/PivecLabs/UIComponents/Actions/Canvas/ActionHideCanvas.cs
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,164 @@ | ||
namespace GameCreator.UIComponents | ||
{ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.Events; | ||
using GameCreator.Core; | ||
using GameCreator.Variables; | ||
|
||
#if UNITY_EDITOR | ||
using UnityEditor; | ||
#endif | ||
|
||
[AddComponentMenu("")] | ||
public class ActionHideCanvas : IAction | ||
{ | ||
|
||
public GameObject canvasPanel; | ||
public RectTransform animpanel; | ||
public bool hide = true; | ||
public enum ALIGN | ||
{ | ||
Top, | ||
Bottom, | ||
Left, | ||
Right | ||
} | ||
public ALIGN alignment = ALIGN.Top; | ||
|
||
|
||
public Vector3 AnimOutPositionTop; | ||
public Vector3 AnimOutPositionBottom; | ||
public Vector3 AnimOutPositionLeft; | ||
public Vector3 AnimOutPositionRight; | ||
|
||
// EXECUTABLE: ---------------------------------------------------------------------------- | ||
|
||
public override bool InstantExecute(GameObject target, IAction[] actions, int index) | ||
{ | ||
|
||
|
||
return false; | ||
} | ||
|
||
public override IEnumerator Execute(GameObject target, IAction[] actions, int index) | ||
{ | ||
|
||
animpanel = canvasPanel.GetComponent<RectTransform>(); | ||
|
||
AnimOutPositionTop = new Vector3(0, animpanel.rect.height, 0); | ||
AnimOutPositionBottom = new Vector3(0, -animpanel.rect.height, 0); | ||
AnimOutPositionLeft = new Vector3(-animpanel.rect.width, 0, 0); | ||
AnimOutPositionRight = new Vector3(animpanel.rect.width, 0, 0); | ||
|
||
if (hide == false) | ||
{ | ||
animpanel.localPosition = new Vector3(0, 0, 0); | ||
} | ||
else | ||
{ | ||
|
||
|
||
switch (this.alignment) | ||
{ | ||
case ALIGN.Top: | ||
|
||
animpanel.localPosition = AnimOutPositionTop; | ||
|
||
break; | ||
case ALIGN.Bottom: | ||
|
||
animpanel.localPosition = AnimOutPositionBottom; | ||
|
||
break; | ||
case ALIGN.Left: | ||
|
||
|
||
animpanel.localPosition = AnimOutPositionLeft; | ||
|
||
|
||
|
||
break; | ||
case ALIGN.Right: | ||
|
||
animpanel.localPosition = AnimOutPositionRight; | ||
|
||
|
||
|
||
break; | ||
} | ||
|
||
} | ||
|
||
|
||
yield return 0; | ||
} | ||
|
||
|
||
|
||
// +--------------------------------------------------------------------------------------+ | ||
// | EDITOR | | ||
// +--------------------------------------------------------------------------------------+ | ||
|
||
#if UNITY_EDITOR | ||
|
||
public static new string NAME = "UI/Canvas/Hide Canvas Panel"; | ||
private const string NODE_TITLE = "Hide Canvas Panel"; | ||
public const string CUSTOM_ICON_PATH = "Assets/PivecLabs/UIComponents/Icons/"; | ||
|
||
// PROPERTIES: ---------------------------------------------------------------------------- | ||
|
||
private SerializedProperty spcanvas; | ||
private SerializedProperty sphide; | ||
private SerializedProperty spAlignment; | ||
|
||
// INSPECTOR METHODS: --------------------------------------------------------------------- | ||
|
||
|
||
|
||
|
||
public override string GetNodeTitle() | ||
{ | ||
|
||
return string.Format(NODE_TITLE); | ||
} | ||
|
||
protected override void OnEnableEditorChild () | ||
{ | ||
|
||
this.spcanvas = this.serializedObject.FindProperty("canvasPanel"); | ||
this.sphide = this.serializedObject.FindProperty("hide"); | ||
this.spAlignment = this.serializedObject.FindProperty("alignment"); | ||
|
||
} | ||
|
||
protected override void OnDisableEditorChild () | ||
{ | ||
|
||
this.spcanvas = null; | ||
this.sphide = null; | ||
this.spAlignment = null; | ||
|
||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
this.serializedObject.Update(); | ||
EditorGUILayout.LabelField("Screen Space - Overlay", EditorStyles.boldLabel); | ||
|
||
EditorGUILayout.PropertyField(this.spcanvas, new GUIContent("Canvas Panel")); | ||
EditorGUILayout.Space(); | ||
EditorGUILayout.PropertyField(this.sphide, new GUIContent("Hide Panel")); | ||
EditorGUILayout.Space(); | ||
EditorGUILayout.LabelField("Properties", EditorStyles.boldLabel); | ||
EditorGUI.indentLevel++; | ||
EditorGUILayout.PropertyField(this.spAlignment, new GUIContent("Hide to")); | ||
EditorGUILayout.Space(); | ||
EditorGUI.indentLevel--; | ||
this.serializedObject.ApplyModifiedProperties(); | ||
} | ||
|
||
#endif | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Alien World/Assets/Gizmos/PivecLabs/UIComponents/Actions/Canvas/ActionHideCanvas.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.