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
// See https://devlogs.fun/projects/89-femto-paint/log/posts/254-making-a-paint-app-in-unity for context | |
using UnityEngine; | |
using UnityEngine.LowLevel; | |
using UnityEngine.InputSystem; | |
using UnityEngine.InputSystem.LowLevel; | |
/// <summary>This is a singleton to help with using Unity for application development. You have to be using the new | |
/// InputSystem for this to work (I haven't tried with legacy input). Put an instance of this in your scene. It works | |
/// by monitoring all input events, and if there hasn't been any event for a short time, it disables all unnecessary |
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
float4 _Roundness; // tl, tr, bl, br | |
fixed4 customRect(v2f i, float2 pos) { | |
float radius = min(_XScale, _YScale); | |
float distToCircle = radius - distance(float2(abs(pos.x), pos.y), float2(_XScale / 2 - radius, _YScale / 2)); | |
float distToSide = _YScale / 2 - abs(pos.y); | |
float dist = when_ge(abs(pos.x), _XScale / 2 - radius) * min(distToSide, distToCircle) | |
+ when_le(abs(pos.x), _XScale / 2 - radius) * distToSide; | |
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
using UnityEngine; | |
using UnityEngine.UI; | |
using TMPro; | |
using Amazon.SimpleNotificationService; | |
using Amazon.Runtime; | |
public class FeedbackUI : MonoBehaviour | |
{ | |
public TMP_InputField feedbackInput; // where the user's message will go | |
public TMP_Text errorMessage; // we'll display any errors here |