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
public static void ResizeTexture(UnityEngine.Texture2D source, int newWidth, int newHeight, UnityEngine.FilterMode filterMode) | |
{ | |
// save the old filtervalue on the source texture before changing it, so we can restore it later. | |
UnityEngine.FilterMode sourceFilterMode = source.filterMode; | |
source.filterMode = filterMode; | |
// use a temporary render texture to for the image data conversion | |
UnityEngine.RenderTexture rt = UnityEngine.RenderTexture.GetTemporary(newWidth, newHeight); | |
rt.filterMode = UnityEngine.FilterMode.Point; | |
UnityEngine.RenderTexture.active = rt; |
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 System.Collections; | |
/// <summary> | |
/// Defines angle limits as the maximum deviation away from the rotation of this object. | |
/// (in other words: if the yawlimit is 45, then you can only move up to 45 degrees away from this rotation in both directions. | |
/// This means the total angle available would be an angle of 90 degrees) | |
/// An angle of 180 allows complete freedom of movement on that axis. | |
/// </summary> | |
public class FocusPoint : MonoBehaviour |