For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
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
/*** | |
* This script will anchor a GameObject to a relative screen position. | |
* This script is intended to be used with ViewportHandler.cs by Marcel Căşvan, available here: http://gamedev.stackexchange.com/a/89973/50623 | |
* It is also copied in this gist below. | |
* | |
* Note: For performance reasons it's currently assumed that the game resolution will not change after the game starts. | |
* You could not make this assumption by periodically calling UpdateAnchor() in the Update() function or a coroutine, but is left as an exercise to the reader. | |
*/ | |
/* The MIT License (MIT) |
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
// An outline shader made for Unity with the help of @OverlandGame by @miichidk | |
// It adjusts the size of the outline to automatically accomodate screen width and camera distance. | |
// See how it looks here: https://twitter.com/OverlandGame/status/791035637583388672 | |
// How to use: Create a material which uses this shader, and apply this material to any meshrenderer as second material. | |
Shader "OutlineShader" | |
{ | |
Properties | |
{ | |
_Width ("Width", Float ) = 1 | |
_Color ("Color", Color) = (1,1,1,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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class FpsController : MonoBehaviour { | |
public float mouseSensitivityX = 1.0f; | |
public float mouseSensitivityY = 1.0f; | |
public float walkSpeed = 10.0f; |
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; | |
public static class ConvertToSpriteExtensiton | |
{ | |
public static Sprite ConvertToSprite(this Texture2D texture) | |
{ | |
return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero); | |
} | |
} |
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
// code reference: http://answers.unity3d.com/questions/894995/how-to-saveload-with-google-play-services.html | |
// you need to import https://github.com/playgameservices/play-games-plugin-for-unity | |
using UnityEngine; | |
using System; | |
using System.Collections; | |
//gpg | |
using GooglePlayGames; | |
using GooglePlayGames.BasicApi; | |
using GooglePlayGames.BasicApi.SavedGame; | |
//for encoding |
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 UnityEngine; | |
using UnityEngine.UI; | |
[ExecuteInEditMode] | |
public class RoundRectGraphic : Graphic { | |
[Range(0, 200)] | |
public int radius; | |
public bool hasTop; |
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; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
// Custom Editor to order the variables in the Inspector similar to Image component | |
[CustomEditor( typeof( CircleGraphic ) ), CanEditMultipleObjects] | |
public class CircleGraphicEditor : 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.Generic; | |
using System.IO; | |
using System.Linq; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
using UnityEngine; | |
public class JsonSerialisableScriptableObject<T> : ScriptableObject where T : JsonSerialisableScriptableObject<T> | |
{ |
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
import 'package:flutter/material.dart'; | |
import 'dart:convert'; | |
import 'dart:async' show Future; | |
import 'package:flutter/services.dart' show rootBundle; | |
class Student { | |
String studentId; | |
String studentName; | |
int studentScores; |
OlderNewer