#Unity Snippets
A collection of useful Unity snippets (CSharp).
##Movement
Boundary.cs
using UnityEngine;| var mediaJSON = { "categories" : [ { "name" : "Movies", | |
| "videos" : [ | |
| { "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
| "subtitle" : "By Blender Foundation", | |
| "thumb" : "images/BigBuckBunny.jpg", | |
| "title" : "Big Buck Bunny" | |
| }, | |
| { "description" : "The first Blender Open Movie from 2006", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
#Unity Snippets
A collection of useful Unity snippets (CSharp).
##Movement
Boundary.cs
using UnityEngine;| // Let's declare two structs that with different variables and different boolean values: | |
| struct A { | |
| let x = true | |
| } | |
| struct B { | |
| let y = false | |
| } |
| var Rx = require('rx') | |
| var slowSource = Rx.Observable.create(function(observer) { | |
| var count = 0 | |
| setInterval(function() { | |
| observer.onNext(count++) | |
| }, 1000) | |
| }) | |
| using UnityEngine; | |
| public class ToastMessage : MonoBehaviour | |
| { | |
| string toastString; | |
| string input; | |
| AndroidJavaObject currentActivity; | |
| AndroidJavaClass UnityPlayer; | |
| AndroidJavaObject context; |
| // Copyright (c) 2022 Piero Dotti, Elf Games | |
| // | |
| // Permission is hereby granted, free of charge, to any person | |
| // obtaining a copy of this software and associated documentation | |
| // files (the "Software"), to deal in the Software without | |
| // restriction, including without limitation the rights to use, | |
| // copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the | |
| // Software is furnished to do so, subject to the following | |
| // conditions: |
A string identifying the build system action being performed.
The locations of any sparse SDKs that should be layered on top of the one specified by Base SDK (SDKROOT). If more than one SDK is listed, the first one has highest precedence. Every SDK specified in this setting should be a "sparse" SDK, for example, not an SDK for an entire macOS release.
| #!/bin/sh | |
| # make-android-icons.sh | |
| # Author: Chad Armstrong | |
| # Date: 11 December 2020 | |
| # Description: Take an image and output to various Android resolutions (ldpi - xxxhdpi) | |
| # This script runs under macOS and requires ImageMagick to be installed. | |
| # Need ImageMagick first |