Skip to content
Snippets Groups Projects
Commit b0b33805 authored by Daniel McCoshen (dam479)'s avatar Daniel McCoshen (dam479)
Browse files

some basic attempts at the teather scripting

parent b17e1baf
No related branches found
No related tags found
No related merge requests found
fileFormatVersion: 2
guid: ceceecf1736316049b0d76bef3391332
folderAsset: yes
timeCreated: 1506339369
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Teather_Child : MonoBehaviour {
public GameObject left;
public GameObject right;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.localScale = new Vector2(Vector2.Distance(left.transform.position, right.transform.position), transform.localScale.y);
}
}
fileFormatVersion: 2
guid: 3b99857f6300f524c86692000bc5b334
timeCreated: 1506341901
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Teather_Parent : MonoBehaviour {
public int health { get; private set; }
public int startingHealth;
// Use this for initialization
void Start () {
health = startingHealth;
}
// Update is called once per frame
void Update () {
}
/// <summary>
/// handles recieved damage message and applies damage to the teather
/// </summary>
/// <param name="damage"> the amount of damage to apply </param>
void damage(int damage)
{
health -= damage;
}
}
fileFormatVersion: 2
guid: b099c732d3d72f44a8848536ac0c087f
timeCreated: 1506340298
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class basicMovement : MonoBehaviour
{
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
var x = Input.GetAxis("Horizontal") * Time.deltaTime * 15.0f;
var z = Input.GetAxis("Vertical") * Time.deltaTime * 15f;
transform.Translate(x, z, 0);
Vector3 MouseWorldPosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0));
transform.LookAt(MouseWorldPosition);
transform.rotation = Quaternion.Euler(new Vector3(0, 0, transform.rotation.eulerAngles.z));
}
}
fileFormatVersion: 2
guid: 6ed4ad17d1b888e4f8cc6e6ae542fb9a
timeCreated: 1506342939
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment