This file contains hidden or 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
if (player.canUseWeapons && current) { | |
Cursor.SetCursor (Resources.Load<Texture2D> ("Crosshair"), new Vector2 (32, 32), CursorMode.Auto); | |
} else { | |
Cursor.SetCursor (null, Vector2.zero, CursorMode.Auto); | |
} |
This file contains hidden or 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
public TMP_InputField inputField; | |
float focusReleaseTime; | |
float focusReleaseCooldown = 0.1f; | |
public bool HasFocus () { | |
return EventSystem.current.currentSelectedGameObject == inputField.gameObject; | |
} | |
public void SetFocus (bool value) { | |
if (value && !inputField.isFocused) { |
This file contains hidden or 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
/** You'll need to provide a .env file at the root folder containing an endpoint, bucket name and access credentials | |
* # AWS_ENDPOINT=https://ams3.digitaloceanspaces.com | |
* # AWS_ACCESS_ID= | |
* # AWS_SECRET_KEY= | |
* # AWS_BUCKET_NAME= | |
*/ | |
const dotenv = require("dotenv"); | |
const fs = require("fs"); | |
const path = require("path"); |
This file contains hidden or 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.IO; | |
using System.Security.Cryptography; | |
using System.Text; | |
public class CypherUtils { | |
public static string Decrypt (string cipherData, string keyString, string ivString) { | |
byte[] key = Encoding.UTF8.GetBytes (keyString); | |
byte[] iv = Convert.FromBase64String (ivString); |
This file contains hidden or 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 DG.Tweening; | |
using TMPro; | |
using UnityEngine; | |
using Wirelab.Pages; | |
public class ChatMessageItemRenderer : ItemRenderer<ChatMessageData> { | |
public BaseEvent onTimeout; |
This file contains hidden or 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
#if UNITY_EDITOR | |
/** | |
This script should be located in an Editor folder | |
No need to try assigning it to a GameObject | |
It will run automatically when playing from the editor or during a build | |
see: https://docs.unity3d.com/ScriptReference/Build.IProcessSceneWithReport.OnProcessScene.html | |
*/ | |
using System; |
This file contains hidden or 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
.dl-horizontal { | |
$definitionWidth: 100px; | |
display: flex; | |
flex-wrap: wrap; | |
> dt { | |
width: $definitionWidth; | |
text-align: left; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
white-space: nowrap; |
This file contains hidden or 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
app.get("/robots.txt", function(req, res) { | |
res.type("text/plain"); | |
var rules = { | |
"User-agent": "*", | |
"Disallow": process.env.NODE_ENV === "production" ? "" : "/" | |
}; | |
var flattenedString = Object.keys(rules) | |
.map((key) => key + ": " + rules[key]) | |
.join("\n"); | |
res.send(flattenedString); |
This file contains hidden or 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
/* example: @include truncate(24px, 30px, 3); */ | |
@mixin truncate($font-size, $line-height, $lines-to-show) { | |
display: block; // Fallback for non-webkit | |
display: -webkit-box; | |
max-width: 400px; | |
font-size: $font-size; | |
line-height: $line-height; | |
-webkit-line-clamp: $lines-to-show; | |
-webkit-box-orient: vertical; |