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.IO; | |
| using System.Xml.Serialization; | |
| namespace MarvelRPG | |
| { | |
| public static class Utilities | |
| { | |
| public static void SerializeXML<T>(string s, T t, string path) | |
| { | |
| if (Directory.Exists(path)) |
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 Run(self): | |
| self.Reset() | |
| open = self.OPEN | |
| closed = self.CLOSED | |
| start = self._start | |
| goal = self._goal | |
| open.append(start) | |
| print(open) | |
| while open: | |
| open.sort(key = lambda x : x.f) |
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; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| public class AStar : MonoBehaviour | |
| { | |
| public enum State | |
| { |
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
| [Serializable] | |
| public enum ButtonCode | |
| { | |
| A, | |
| B, | |
| X, | |
| Y, | |
| DpadUp, | |
| DpadDown, | |
| DpadLeft, |
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; | |
| class TranInputController : MonoBehaviour | |
| { | |
| Animator anim; | |
| void Update() | |
| { | |
| if(Input.GetKeyDown(KeyCode.D)) | |
| { |
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 Motion(int x, int y) | |
| { | |
| if (mouseMoving) | |
| { | |
| //get the change in x since mouse down and increment | |
| mouse_long += (x - oldX); | |
| rLong = Rotation(mouse_long, 'y'); |
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
| //notes: 3/3/2014 boids keep flying to flock even though they should be ignoring them | |
| //written by Matthew Williamson | |
| //adapted from Conrad Parker's pseudocode of Craig W. Reynold's Boid's algorithm | |
| //for Unity3D | |
| //http://www.red3d.com/cwr | |
| using UnityEngine; | |
| using System.Collections; | |
| //adaptation of Boids pseudocode into Unity taken from http://www.kfish.org/boids/pseudocode.html | |
| public class BoidAlgorithm : MonoBehaviour |
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; | |
| //cloth simulation | |
| [Serializable] | |
| public class Particle | |
| { | |
| public Vector3 Position | |
| { | |
| get |
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.Text; | |
| namespace FiniteStateMachine | |
| { | |
| //Handles the function calls | |
| public delegate void Handler(); | |
| //State class used for creating a state 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
| /// Credit to Ryan Hipple from Schell Games | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using System; | |
| /// <summary> | |
| /// Create a GameEvent in the Project View | |
| /// This Event should be something meaningful. Ex: GameStart | |
| /// The GameStart.asset will have its reference used in the project |