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; | |
public class CharacterController2D : MonoBehaviour | |
{ | |
public Vector2 temp; //Temporary Vector2 variable, as you cannot modify this information directly | |
public float X = 10; //Initial speed | |
void Start () | |
temp = transform.position; //At the initialization of this script, set the temp's values equal to the attached object | |
} |
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 UnityEngine; | |
using UnityEngine.Networking; | |
using UnityStandardAssets.CrossPlatformInput; | |
namespace UnityStandardAssets.Characters.ThirdPerson | |
{ | |
[RequireComponent(typeof (ThirdPersonCharacter))] | |
public class ThirdPersonUserControl : NetworkBehaviour | |
{ |
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 NetworkSyncAnimation : MonoBehaviour { | |
//enum must stand for enumeration, so I believe this variable stores an array of integers | |
public enum AniStates | |
{ | |
walk = 0, | |
run, | |
kick, | |
punch, |
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 UnityEngine.UI; | |
using System.Collections; | |
public class NetworkManager : MonoBehaviour { | |
public const string typeName = "102398471982374987"; | |
public const string gameName = "RoomName"; | |
public GameObject playerPrefab; | |
public GameObject MainMenuCanvas; |
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; | |
public class doorAnim : MonoBehaviour { | |
public void playOpen() { | |
GetComponent<Animation>()["OpenDoor"].speed = 1; | |
GetComponent<Animation>().Play("OpenDoor"); | |
} | |
public void playClose() { |
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 doorAnim : MonoBehaviour { | |
public float lengthOfAnim; | |
public AnimationState anim; | |
public string animName = "Open Door Up"; | |
bool open = false; | |
float animTime; |
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
def ls(path): | |
s = subprocess.Popen(["dir", path], shell=True, stdout=subprocess.PIPE).stdout | |
service_state = s.read().splitlines() | |
temp_li = [] | |
li = [] | |
for i in service_state: | |
temp_li.append(i.decode('ascii')) | |
for i in temp_li[7:-2]: | |
li.append(i.split()[4]) |
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
# David Crawford | |
# Regex function for retrieving an XML attribute from a dataframe without needing to convert any objects for modules like ElementTree | |
import re | |
# Returns the first occurance of an attribute's value | |
def reg(data): | |
pattern = '(?<=ATTRIBUTE_NAME=").*?(?=")' | |
x = re.findall(pattern, data) | |
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
window['var_name'] // Call global var name programatically | |
// Dynamically change page title based on user input | |
var imp = document.getElementByID('myinout'); | |
var currentText = ''; | |
imp.addEventListener('keydown', ev => { | |
console.log(ev); | |
currentText += ev.key.toString(); | |
document.title = currentText; | |
console.log(currentText); |
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
set tResults = [] | |
WHILE rSet.%Next() { | |
// Init object for holding the values | |
set tRow = {} | |
// The following iterates over the dynamic sql object and dynamically sets values using indirection | |
set tMetadata = rSet.%GetMetadata() | |
// Get size of returned object | |
set tColumnCount = tMetadata.columns.Count() | |
// Loop through the count | |
for x=1:1:tColumnCount { |
OlderNewer