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
class BinaryIndexedTree(private var nums: IntArray) { | |
var size: Int = nums.size | |
private val _bit = IntArray(size + 1) | |
init { | |
for (i in 0 until size) init(i, nums[i]) | |
} | |
private fun init(index: Int, value: Int) { | |
var i = index + 1 |
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 System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
namespace Utils | |
{ | |
public class GroundHelper | |
{ | |
private const float minMoveDistance = 0.001f; | |
private const float shellRadius = 0.01f; |
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 System.Collections.Generic; | |
using UnityEngine.SceneManagement; | |
namespace Tools | |
{ | |
public static class SceneStacker | |
{ | |
private static readonly Stack<string> SceneStack = new(); | |
private static bool sIsInitialization; |
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
// https://stackoverflow.com/questions/36888780/how-to-make-an-invisible-transparent-button-work | |
// file Touchable.cs | |
// Correctly backfills the missing Touchable concept in Unity.UI's OO chain. | |
using UnityEngine; | |
using UnityEngine.UI; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
[CustomEditor(typeof(Touchable))] | |
public class Touchable_Editor : Editor |
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 System; | |
using System.Collections; | |
using UnityEngine; | |
namespace Util | |
{ | |
public static class AnimationCurveEx | |
{ | |
public static IEnumerator PlayEvaluate(this AnimationCurve curve, float time, Action<float> action, params Tuple<float, Action>[] animationEvents) | |
{ |
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; | |
namespace Game | |
{ | |
public class FillScreen : MonoBehaviour | |
{ | |
public SpriteRenderer sr; | |
private void Awake() | |
{ |
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 Common; | |
using UnityEngine; | |
using UnityEngine.InputSystem; | |
namespace Game | |
{ | |
public class InputCtlr : MonoBehaviour | |
{ | |
private InputActions inputActions; |
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
fun main() { | |
val root = NodeBuilder { | |
"Ali"{ | |
"Bob"{ | |
"Candy"() | |
"Dave"() | |
} | |
"Egg"{ | |
"Fold"() | |
} |
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 System; | |
using UnityEngine; | |
namespace Lina.Scripts | |
{ | |
public struct Inputer2DHelper | |
{ | |
private Vector2 move; | |
private bool fire1; |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class PhysicsObject : MonoBehaviour { | |
public float minGroundNormalY = .65f; | |
public float gravityModifier = 1f; | |
protected Vector2 targetVelocity; |