Skip to content

Instantly share code, notes, and snippets.

@RodrigoLegendre
RodrigoLegendre / gist:6290fa896895f7c8a0e07f60f9516727
Created June 11, 2021 00:54
Unity InputSystem drag input, done properly(?)
private PlayerInput PlayerInputComponent => _playerInputComponent ??= GetComponent<PlayerInput>();
//Can be better with GUID instead of string, but will do for now
private InputAction DragPosition => _dragPosition ??= PlayerInputComponent.actions.FindAction("DragPosition");
#region Event Functions
private void Update() {
if (StartPoint.gameObject.activeInHierarchy && EndPoint.gameObject.activeInHierarchy)
Debug.DrawLine(StartPoint.position, EndPoint.position, Color.white, 0, false);
}
@RodrigoLegendre
RodrigoLegendre / Main.java
Created November 1, 2015 23:54
StackOverflow - Q33467878 - MCVE by TheLima
/*
If you get "END!" without any results, we have a problem.
My result is:
"2567
2576
END!"
*/
package Q_33467878;
import java.util.regex.Matcher;
@RodrigoLegendre
RodrigoLegendre / Main.java
Last active November 1, 2015 22:10
StackOverflow - Q33467177 - MCVE by TheLima
/*
USE NEGATIVE NUMBERS TO EXIT, IN ANY INPUT
*/
package Q_33467177;
import java.awt.Point;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;