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 RenderHeads.Media.AVProVideo; | |
public class VideoPlayerController : MonoBehaviour | |
{ | |
public string videoURL = "YOUR_VIDEO_URL_HERE"; | |
public bool playOnStart = true; | |
private MediaPlayer mediaPlayer; |
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
List<Device> childDevices = new List<Device> | |
{ | |
new Device { Id = 1 }, | |
}; | |
List<Device> parentDevices = new List<Device> | |
{ | |
new Device { Id = 1 }, // Parent device with ID 1 | |
new Device { Id = 4 } // Parent device with ID 4 |
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 class LinkRectTransforms : MonoBehaviour | |
{ | |
public RectTransform rectTransform1; | |
public RectTransform rectTransform2; | |
private void Update() | |
{ | |
// Get the current position of the right edge of RectTransform1 |
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 System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class CanvasItemScale : MonoBehaviour | |
{ | |
public CanvasScaler target; | |
public RectTransform targetTransform; |
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
//demonstrates a static string being accessed and updated by multiple threads using a lock for synchronization: | |
using System; | |
using System.Threading; | |
public class Program | |
{ | |
// Static string variable | |
private static string sharedString = "Initial Value"; |
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.Management; | |
namespace DeviceStatsLogger | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Retrieving device stats..."); |
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 class JoystickCameraController : MonoBehaviour | |
{ | |
public float joystickSensitivity = 0.1f; | |
public float rotationSpeed = 5f; | |
public float zoomSpeed = 2f; | |
private Vector2 joystickInput; | |
private Transform cameraTransform; |
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
private IEnumerator PostRegistrationDetails(string jsonData) | |
{ | |
var raw = Encoding.UTF8.GetBytes(jsonData); | |
using UnityWebRequest webRequest = UnityWebRequest.Post(uriPostResults, "POST"); | |
webRequest.SetRequestHeader("Content-Type", "application/json"); | |
webRequest.uploadHandler = new UploadHandlerRaw(raw); | |
webRequest.uploadHandler.contentType = "application/json"; | |
webRequest.downloadHandler = new DownloadHandlerBuffer(); | |
webRequest.SendWebRequest(); | |
if (webRequest.isNetworkError || webRequest.isHttpError) |
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
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol) | |
pragma solidity ^0.8.0; | |
import "./IERC20.sol"; | |
import "./extensions/IERC20Metadata.sol"; | |
import "../../utils/Context.sol"; | |
/** |
NewerOlder