Commit 2ee663c1 authored by tmorga18's avatar tmorga18
Browse files

Merge branch 'character' of git.gmu.edu:gadig/four into character

parents ecc210d7 c0f97470
fileFormatVersion: 2
guid: 6d6525803f9c2de4e8233fc51322fdc5
folderAsset: yes
timeCreated: 1476403153
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: fdbf72d4ce210a1429dd9df6dc03dafc
folderAsset: yes
timeCreated: 1476403235
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 531e32ee5325d9b42bb4ec6a1dff629a
timeCreated: 1476404837
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3a68a9d48e0026946b2b84e18fcf793e
timeCreated: 1476404883
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c0ac508780ce38c4fa9f213da519f5d3
timeCreated: 1476403159
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3fd9c01e8800fc54681146f720a0d04b
folderAsset: yes
timeCreated: 1477008945
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1e017f03500f8e6488ddf22b93a4fc64
timeCreated: 1477008948
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 23488e1df8bc4dc4a9f405df41ec5fb3
folderAsset: yes
timeCreated: 1476402444
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 991cd4abf4f00e44b8d6bb62b0c51e3f
timeCreated: 1476402447
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 67353cb7d3506f644a7bba4b5823d726
timeCreated: 1475801963
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class HeroAttackController : MonoBehaviour {
enum ability {fireball, water, others };
private ability currentAbility = ability.fireball;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update(){
if (Input.GetButtonDown("Fire1")){
switch (currentAbility)
{
case ability.fireball:
Debug.Log("fireball");
break;
default:
Debug.Log("default");
break;
}
}
if (Input.GetButtonDown("Fire2")){
Debug.Log("melee");
}
}
}
fileFormatVersion: 2
guid: 9d62da0ef0f1b3d4a830a1a99cdb161d
timeCreated: 1477008563
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e247c9d5f5c5cd6468589367fbee44ef
timeCreated: 1477008563
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class PlayerAnimation : MonoBehaviour {
private Animator animator;
private Vector2 lastInput = new Vector2(1, 1);
private int horizontalDir = 1;
// Use this for initialization
void Start () {
animator = GetComponent<Animator>();
}
// Update is called once per frame
void Update () {
AminateMovement();
}
void AminateMovement() {
Vector2 input = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
if (Mathf.Abs(input.x) > 0 || Mathf.Abs(input.y) > 0) {
lastInput.x = input.x;
lastInput.y = input.y;
}
if(lastInput.x < 0 && input.y == 0) {
horizontalDir = -1;
}else {
horizontalDir = 1;
}
animator.SetFloat("X", Mathf.Abs(lastInput.x));
animator.SetFloat("Y", lastInput.y);
Vector2 scale = transform.localScale;
scale.x = horizontalDir;
transform.localScale = scale;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment