Skip to content

Instantly share code, notes, and snippets.

View dxball's full-sized avatar
💭
Work in progress 👻

Dxball ☕ dxball

💭
Work in progress 👻
View GitHub Profile
@dxball
dxball / UIGradient.ts
Created July 14, 2022 06:52
Cocos 3.X Gradient
import { _decorator, Color, Component, Renderable2D } from "cc";
const {
ccclass,
property,
requireComponent,
disallowMultiple,
executeInEditMode,
} = _decorator;
@dxball
dxball / memo.md
Last active December 7, 2018 09:01
Mono remote debug

Windows side

  • Install VcXsrv
  • Install WSL (Ubuntu)
  • Win+R, enter ubuntu
  • open vcxsrv (XLanuch)

WSL

  • set display variable
export DISPLAY=127.0.0.1:0
@dxball
dxball / DisableTouchConversionToMouse.cs
Last active September 5, 2018 08:55 — forked from ulatekh/DisableTouchConversionToMouse.cs
Globally disable the conversion of touch events to mouse events in Windows 7
namespace BlackFox
{
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Security;
/// <summary>
/// As long as this object exists all mouse events created from a touch event for legacy support will be disabled.
/// Or, at least, that's the promise. But the system mouse-cursor still gets set to the position of the last
@dxball
dxball / Gradient.cs
Created August 10, 2018 06:37
Unity UI Text Gradient effect
using System.Collections.Generic;
/// <summary>
/// Modified Gradient effect script from http://answers.unity3d.com/questions/1086415/gradient-text-in-unity-522-basevertexeffect-is-obs.html
/// -Uses Unity's Gradient class to define the color
/// -Offset is now limited to -1,1
/// -Multiple color blend modes
///
/// Remember that the colors are applied per-vertex so if you have multiple points on your gradient where the color changes and there aren't enough vertices, you won't see all of the colors.
/// </summary>
@dxball
dxball / ShakeEffect.cs
Last active August 29, 2015 14:14
Shake Object by given Time, Range & Magnitude Curve.
using UnityEngine;
public class ShakeEffect : MonoBehaviour {
private float m_ShakeTime = 0.0f;
private float m_StartShakeTime = 0.0f;
public Vector3 ShakeRange = new Vector3 (0.2f, 0.05f, 0.1f);
[SerializeField]
private AnimationCurve m_ShakeCurve = new AnimationCurve(new Keyframe(0.0f, 1.0f), new Keyframe(1.0f, 1.0f));