-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
Updated the rest of the ui to be able to be used in 3d. Only part that does not work is the placement of the picker on the box area not matching up with the cursor due to not getting the math right in HSVBoxSelector.cs
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using UnityEngine.EventSystems; | ||
using UnityEngine.UI; | ||
|
||
public class ColorScrollRect : ScrollRect | ||
{ | ||
|
||
public bool Dragging { get; private set; } | ||
|
||
|
||
public override void OnInitializePotentialDrag(PointerEventData eventData) | ||
{ | ||
Dragging = true; | ||
base.OnInitializePotentialDrag(eventData); | ||
} | ||
|
||
public override void OnBeginDrag(PointerEventData eventData) | ||
{ | ||
Dragging = true; | ||
base.OnBeginDrag(eventData); | ||
} | ||
|
||
public override void OnDrag(PointerEventData eventData) | ||
{ | ||
Dragging = true; | ||
base.OnDrag(eventData); | ||
} | ||
|
||
public override void OnEndDrag(PointerEventData eventData) | ||
{ | ||
Dragging = false; | ||
base.OnEndDrag(eventData); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using UnityEngine; | ||
|
||
public class TiltWindow : MonoBehaviour | ||
{ | ||
public Vector2 range = new Vector2(5f, 3f); | ||
|
||
Transform mTrans; | ||
Quaternion mStart; | ||
Vector2 mRot = Vector2.zero; | ||
|
||
void Start () | ||
{ | ||
mTrans = transform; | ||
mStart = mTrans.localRotation; | ||
} | ||
|
||
void Update () | ||
{ | ||
Vector3 pos = Input.mousePosition; | ||
|
||
float halfWidth = Screen.width * 0.5f; | ||
float halfHeight = Screen.height * 0.5f; | ||
float x = Mathf.Clamp((pos.x - halfWidth) / halfWidth, -1f, 1f); | ||
float y = Mathf.Clamp((pos.y - halfHeight) / halfHeight, -1f, 1f); | ||
mRot = Vector2.Lerp(mRot, new Vector2(x, y), Time.deltaTime * 5f); | ||
|
||
mTrans.localRotation = mStart * Quaternion.Euler(-mRot.y * range.y, mRot.x * range.x, 0f); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeEditing/ContextActionTable/DisabledContextActions/=JetBrains_002EReSharper_002EIntentions_002EJavaScript_002EContextActions_002ESplitDeclarationsListAction/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeEditing/ContextActionTable/DisabledContextActions/=JetBrains_002EReSharper_002EIntentions_002EJavaScript_002EContextActions_002ESplitDeclarationAction/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeEditing/ContextActionTable/DisabledContextActions/=JetBrains_002EReSharper_002EIntentions_002EJavaScript_002EContextActions_002EReverseAssignmentAction/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeEditing/ContextActionTable/DisabledContextActions/=JetBrains_002EReSharper_002EIntentions_002EJavaScript_002EContextActions_002ERemoveBracesAction/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeEditing/ContextActionTable/DisabledContextActions/=JetBrains_002EReSharper_002EIntentions_002EJavaScript_002EContextActions_002EIntroduceVariableAction/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeEditing/ContextActionTable/DisabledContextActions/=JetBrains_002EReSharper_002EIntentions_002EJavaScript_002EContextActions_002ECreateFromUsage_002ECreateFromUsageAction/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeEditing/ContextActionTable/DisabledContextActions/=JetBrains_002EReSharper_002EFeatures_002EWeb_002EJavaScriptXmlDocReferenceToFile_002EQuickFixes_002EAddReferenceAction/@EntryIndexedValue">True</s:Boolean> | ||
<s:String x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntellisenseGloballyEnabled/IntellisenseEnabled/@EntryValue">PerTechnology</s:String> | ||
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntellisenseEnabled/IntellisenseEnabledSettingCSharp/IntellisenseEnabled/@EntryValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntellisenseEnabled/IntellisenseEnabledSettingXaml/IntellisenseEnabled/@EntryValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntellisenseEnabled/IntellisenseEnabledSettingMSBuild/IntellisenseEnabled/@EntryValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntellisenseEnabled/IntellisenseEnabledSettingNAnt/IntellisenseEnabled/@EntryValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Ejs/@EntryIndexedValue">True</s:Boolean> | ||
<s:String x:Key="/Default/Environment/UserInterface/ShortcutSchemeName/@EntryValue">None</s:String> | ||
<s:Boolean x:Key="/Default/Environment/UserInterface/TipsManager/ShowTipsOnStartup/@EntryValue">False</s:Boolean> | ||
</wpf:ResourceDictionary> |