This file contains hidden or 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.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
/* | |
* Polymorphism practice. Doing exercises selected by Zack for me. | |
* http://tutorials.csharp-online.net/Inheritance_and_Polymorphism%E2%80%94Exercises | |
* |
This file contains hidden or 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.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ |
This file contains hidden or 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 CoroutineCounter : MonoBehaviour { | |
// Use this for initialization | |
void Start () { | |
//StartCoroutine("CountSeconds"); //works | |
StartCoroutine("SayHelloEveryFrame"); //doesn't work |
This file contains hidden or 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 class PowerupTouch : MonoBehaviour { | |
void OnTriggerEnter(Collider other){ | |
GetComponent<MeshRenderer>().material.color = Color.green; | |
transform.renderer.material.color = Color.blue; | |
} | |
} |
This file contains hidden or 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 SnakeBody : MonoBehaviour { | |
private float moveSpeed = 5f; | |
private float rotationSpeed = 10f; | |
private Transform target; | |
private Transform source; |
This file contains hidden or 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
void Update(){ | |
//constantly check player positions.. | |
//find furthest apart X, Y | |
//adjust camera accordingly | |
Vector2 min; | |
Vector2 max; | |
//ASK ZACK: what's best way to initalize this? | |
if ( PlayerGOs != null ) { |
This file contains hidden or 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 class PlayerControl : MonoBehaviour { | |
//... | |
private class Directions{ | |
KeyCode Up; | |
KeyCode Down; | |
KeyCode Left; | |
KeyCode Right; | |
} |
This file contains hidden or 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 void RemoveUserGO(GameObject go){ | |
int i = UserCreatedGOs.FindIndex( obj => obj.GetInstanceID = go.GetInstanceID ); | |
UserCreatedGOs.RemoveAt(i); | |
//...do more with i | |
} |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder