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
//Adjust the size of the transform to ocuppy the whole size of the camera being rendered | |
void Start () { | |
float distance = Vector3.Distance(Camera.main.transform.position, transform.position); | |
float sizeHeight = Mathf.Tan(Mathf.Deg2Rad * Camera.main.fieldOfView/2) * distance; | |
float radAngle = Camera.main.fieldOfView * Mathf.Deg2Rad; | |
float radHFOV = 2 * Mathf.Atan(Mathf.Tan(radAngle / 2) * Camera.main.aspect); | |
float hFOV = Mathf.Rad2Deg * radHFOV; |
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; | |
public class ExampleClass : MonoBehaviour { | |
public Transform gunObj; | |
void Update() { | |
if (Input.GetMouseButton(0)) { | |
RaycastHit hit; | |
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); | |
if (Physics.Raycast(ray, out hit)) { |
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
/* | |
Created by | |
Juan Sebastian Munoz Arango | |
naruse@gmail.com | |
all rights reserved | |
*/ | |
namespace ProDrawCall { | |
using System; | |
using System.Collections.Generic; |
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
/* | |
Created by | |
Juan Sebastian Munoz Arango | |
naruse@gmail.com | |
all rights reserved | |
*/ | |
namespace ProDrawCall { | |
using System; | |
using System.Collections.Generic; |
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
[MenuItem("FixLODRendeer")] | |
static void LODRendeer() | |
{ | |
LODGroup[] lodgroups = (LODGroup[])GameObject.FindObjectsOfType(typeof(LODGroup)); | |
//For every LOD group: get the current groups and get the renderer names.. | |
foreach (LODGroup lodgroup in lodgroups) | |
{ | |
SerializedObject obj = new SerializedObject(lodgroup); | |
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; | |
using System.Collections.Generic; | |
using UnityEditor; | |
public class LODFixer { | |
[MenuItem("Window/FixLODRendeer")] | |
static void LODRendeer() |
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
/* | |
Problem: | |
Given 2 strings, write a method to know if one is a permutation of the | |
other. | |
Approach: | |
if we assume the string is in ASCII, we can use an integer array of 256 | |
chars and mark the used chars and add them. | |
Assuming the interviewer mentions the string is in UNICODE, then the max # |
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
/* | |
Created by: Juan Sebastian Munoz Arango | |
naruse@gmail.com | |
2014 | |
www.pencilsquaregames.com | |
Feel free to use it for your personal / commercial projects. | |
a mention of the source would be nice but if you dont feel like | |
its alright. | |
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
/* | |
--- Day 4: Repose Record --- | |
You've sneaked into another supply closet - this time, it's across | |
from the prototype suit manufacturing lab. You need to sneak inside | |
and fix the issues with the suit, but there's a guard stationed | |
outside the lab, so this is as close as you can safely get. | |
As you search the closet for anything that might help, you discover | |
that you're not the first person to want to sneak in. Covering the | |
walls, someone has spent an hour starting every midnight for the past |
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
[1518-05-11 00:22] falls asleep | |
[1518-10-11 00:51] wakes up | |
[1518-10-12 00:31] wakes up | |
[1518-04-08 00:57] wakes up | |
[1518-09-26 23:59] Guard #2851 begins shift | |
[1518-11-06 00:40] wakes up | |
[1518-08-06 00:04] Guard #2851 begins shift | |
[1518-09-27 00:54] wakes up | |
[1518-07-09 00:00] Guard #2153 begins shift | |
[1518-04-11 00:37] falls asleep |