Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into experiments/moonsharp
Browse files Browse the repository at this point in the history
  • Loading branch information
andybak committed Dec 7, 2023
2 parents ecd7a8d + b9d2534 commit eef540e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 59 deletions.
2 changes: 1 addition & 1 deletion Assets/Prefabs/Panels/SketchbookPanel.prefab
Expand Up @@ -13518,7 +13518,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &4459060226476560
Transform:
m_ObjectHideFlags: 0
Expand Down
6 changes: 3 additions & 3 deletions Assets/Prefabs/PopUps/PopUpWindow_SketchbookMenu.prefab
Expand Up @@ -244,8 +244,8 @@ MonoBehaviour:
m_CommandParam: -1
m_CommandParam2: -1
m_RequiresPopup: 1
m_CenterPopupOnButton: 0
m_PopupOffset: {x: 0, y: 0, z: 0}
m_CenterPopupOnButton: 1
m_PopupOffset: {x: -0.5, y: 0, z: 0}
m_PopupText: Delete Sketch?
m_LocalizedPopup:
m_TableReference:
Expand Down Expand Up @@ -972,7 +972,7 @@ MonoBehaviour:
m_CommandParam: -1
m_CommandParam2: -1
m_RequiresPopup: 1
m_CenterPopupOnButton: 0
m_CenterPopupOnButton: 1
m_PopupOffset: {x: 0, y: 0, z: 0}
m_PopupText: POPUP_SKETCHMENU_BUTTON_DESCRIPTION_RENAME_SKETCH
m_LocalizedPopup:
Expand Down
71 changes: 43 additions & 28 deletions Assets/Prefabs/PopUps/PopUpWindow_SketchbookMenuMobile.prefab
Expand Up @@ -148,8 +148,8 @@ MonoBehaviour:
m_CommandParam: -1
m_CommandParam2: -1
m_RequiresPopup: 1
m_CenterPopupOnButton: 0
m_PopupOffset: {x: 0, y: 0, z: 0}
m_CenterPopupOnButton: 1
m_PopupOffset: {x: -0.5, y: 0, z: 0}
m_PopupText: Delete Sketch?
m_LocalizedPopup:
m_TableReference:
Expand Down Expand Up @@ -208,7 +208,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2401559431439275723}
- {fileID: 3509990010246375632}
- {fileID: 2522356126886229424}
- {fileID: 4622222376755218}
- {fileID: 1094303789834331009}
m_Father: {fileID: 0}
Expand Down Expand Up @@ -239,9 +239,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1bbca9ea9d044b7d8eed27d87c0e27f4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Background: {fileID: 0}
m_TopBorder: {fileID: 0}
m_BottomBorder: {fileID: 0}
m_Background: {fileID: 1090441768425281765}
m_TopBorder: {fileID: 1090441766772313093}
m_BottomBorder: {fileID: 1090441766772313093}
m_WindowText: {fileID: 0}
m_CharacterWidth: 0.175
m_SubtitleCharacterWidth: 0.05625
Expand Down Expand Up @@ -646,34 +646,34 @@ MonoBehaviour:
references:
version: 2
RefIds: []
--- !u!1 &7618307228339125668
--- !u!1 &8794794319778373828
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3509990010246375632}
- component: {fileID: 3452336366428283244}
- component: {fileID: 1701641132094305945}
- component: {fileID: 3291455836607562998}
- component: {fileID: 4958260949495540324}
- component: {fileID: 5639526516156556386}
- component: {fileID: 2522356126886229424}
- component: {fileID: 4349880735921617932}
- component: {fileID: 299974542449601529}
- component: {fileID: 4474697303140309398}
- component: {fileID: 6303773706488231684}
- component: {fileID: 6770976932719409410}
m_Layer: 16
m_Name: Rename
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3509990010246375632
--- !u!4 &2522356126886229424
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7618307228339125668}
m_GameObject: {fileID: 8794794319778373828}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.136, y: -0.25900006, z: -0.12}
m_LocalScale: {x: 0.4375, y: 0.4375, z: 0.43750003}
Expand All @@ -682,21 +682,21 @@ Transform:
m_Father: {fileID: 4667049783313494}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3452336366428283244
--- !u!33 &4349880735921617932
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7618307228339125668}
m_GameObject: {fileID: 8794794319778373828}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1701641132094305945
--- !u!23 &299974542449601529
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7618307228339125668}
m_GameObject: {fileID: 8794794319778373828}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
Expand Down Expand Up @@ -732,29 +732,29 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &3291455836607562998
--- !u!65 &4474697303140309398
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7618307228339125668}
m_GameObject: {fileID: 8794794319778373828}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1.0000001, y: 1.0000001, z: 0.01}
m_Center: {x: 0, y: 0, z: -0.01}
--- !u!114 &4958260949495540324
--- !u!114 &6303773706488231684
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7618307228339125668}
m_GameObject: {fileID: 8794794319778373828}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6c6859eec74651247968d56b594ac313, type: 3}
m_Script: {fileID: 11500000, guid: 68ab65faed9850448927b196242878d7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_DescriptionType: 0
Expand Down Expand Up @@ -795,7 +795,7 @@ MonoBehaviour:
m_CommandParam: -1
m_CommandParam2: -1
m_RequiresPopup: 1
m_CenterPopupOnButton: 0
m_CenterPopupOnButton: 1
m_PopupOffset: {x: 0, y: 0, z: 0}
m_PopupText: POPUP_SKETCHMENU_BUTTON_DESCRIPTION_RENAME_SKETCH
m_LocalizedPopup:
Expand All @@ -820,16 +820,31 @@ MonoBehaviour:
m_ToggleOnTexture: {fileID: 0}
m_AllowUnavailable: 0
m_LinkedUIObject: {fileID: 0}
m_BeforePopupAction:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: TiltBrush.MenuPopUpWindow, Assembly-CSharp
m_MethodName: SetInitialKeyboardText
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
references:
version: 2
RefIds: []
--- !u!114 &5639526516156556386
--- !u!114 &6770976932719409410
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7618307228339125668}
m_GameObject: {fileID: 8794794319778373828}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3}
Expand All @@ -844,7 +859,7 @@ MonoBehaviour:
type: {class: TrackedMonoBehaviourObject, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects,
asm: Unity.Localization}
data:
m_Target: {fileID: 4958260949495540324}
m_Target: {fileID: 6303773706488231684}
m_TrackedProperties:
items:
- rid: 5031208484486512643
Expand Down
9 changes: 0 additions & 9 deletions Assets/Scripts/API/ApiMethods.MultiMirror.cs
Expand Up @@ -97,15 +97,6 @@ public static void WallpaperSymmetrySkewX(float x, float y)
PointerManager.m_Instance.CalculateMirrors();
}

[ApiEndpoint("symmetry.colorshift.enable",
description: "Enables or disables symmetry color shift",
exampleUsage: "on")]
public static void SymmetryColorShiftEnabled(bool enabled)
{
PointerManager.m_Instance.m_SymmetryColorShiftEnabled = enabled;
PointerManager.m_Instance.CalculateMirrors();
}

[ApiEndpoint("symmetry.colorshift.hue",
description: "Sets the custom wallpaper color shift hue (mode is one of SineWave, SquareWave, SawtoothWave, TriangleWave, Noise)",
exampleUsage: "Noise,1,2")]
Expand Down
7 changes: 0 additions & 7 deletions Assets/Scripts/GUI/MirrorOptionsPopUpWindow.cs
Expand Up @@ -96,8 +96,6 @@ public override void Init(GameObject rParent, string sText)
m_WallpaperScaleSliderY.SetInitialValueAndUpdate(PointerManager.m_Instance.m_WallpaperSymmetryScaleY);
m_WallpaperSkewSliderX.SetInitialValueAndUpdate(PointerManager.m_Instance.m_WallpaperSymmetrySkewX);
m_WallpaperSkewSliderY.SetInitialValueAndUpdate(PointerManager.m_Instance.m_WallpaperSymmetrySkewY);

// m_ToggleJitter.m_InitialToggleState = PointerManager.m_Instance.m_SymmetryColorShiftEnabled;
}

public OptionButton GetParentButton()
Expand Down Expand Up @@ -493,11 +491,6 @@ public void HandleWaveformButtons(TextActionButton btn)
}
}

public void HandleToggleColorShift(ActionToggleButton btn)
{
PointerManager.m_Instance.m_SymmetryColorShiftEnabled = btn.ToggleState;
}

public void HandleChangeAmp(Vector3 value)
{
UpdateActiveColorShiftValues(freq: -1, amp: value.z);
Expand Down
22 changes: 11 additions & 11 deletions Assets/Scripts/PointerManager.cs
Expand Up @@ -76,8 +76,6 @@ public enum ColorShiftComponent

[NonSerialized] public bool m_SymmetryLockedToController = false;

[NonSerialized] public bool m_SymmetryColorShiftEnabled = true;

[Serializable]
public struct ColorShiftComponentSetting
{
Expand Down Expand Up @@ -983,7 +981,7 @@ public void SetSymmetryMode(SymmetryMode mode, bool recordCommand = true)
// Don't call CalculateMirrorPointers
// as this is handled below
CalculateMirrorMatrices();
CalculateMirrorColors();
CalculateMirrorColors(m_CustomMirrorMatrices.Count);
active = m_CustomMirrorMatrices.Count;
break;
case SymmetryMode.ScriptedSymmetryMode:
Expand Down Expand Up @@ -1167,15 +1165,15 @@ private void CalculateMirrorMatrices()

public void CalculateMirrorColors()
{
if (m_SymmetryColorShiftEnabled)
CalculateMirrorColors(m_NumActivePointers);
}

public void CalculateMirrorColors(int numPointers)
{
m_SymmetryPointerColors = new List<Color>();
for (float i = 0; i < numPointers; i++)
{
m_SymmetryPointerColors = new List<Color>();
for (float i = 0; i < m_NumActivePointers; i++)
{
m_SymmetryPointerColors.Add(CalcColorShift(m_lastChosenColor, i / m_NumActivePointers));
// BrushDescriptor desc = BrushCatalog.m_Instance.GetBrush(MainPointer.CurrentBrush.m_Guid);
// script.BrushSize01 = GenerateJitteredSize(desc, MainPointer.BrushSize01);
}
m_SymmetryPointerColors.Add(CalcColorShift(m_lastChosenColor, i / numPointers));
}
}

Expand Down Expand Up @@ -1681,6 +1679,8 @@ void InitiateLine(bool isContinue = false)

bool resetColors = true;
bool resetBrushes = true;
// Currently only Multimirror mode shows UI for color shift
// So disable it for all other modes
// TODO Better logic around when to set and revert colors
if (CurrentSymmetryMode is SymmetryMode.ScriptedSymmetryMode or SymmetryMode.MultiMirror)
{
Expand Down

0 comments on commit eef540e

Please sign in to comment.