Merge branch 'darrel'

Manually resolved conflicts. Discarded scene changes.
This commit is contained in:
calebp 2017-09-05 20:30:22 -05:00
commit 071230b9f2
5 changed files with 57 additions and 3 deletions

View file

@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraController : MonoBehaviour {
public GameObject player;
private Vector3 offset;
private Vector3 newPosition;
private float minX, maxX, minY, maxY;
void Start () {
offset = transform.position - player.transform.position;
minX = 0.0f;
maxX = 0.0f;
minY = 0.0f;
maxY = 18.0f;
}
void LateUpdate () {
newPosition = player.transform.position + offset;
if(newPosition.x >= minX && newPosition.x <= maxX && newPosition.y >= minY && newPosition.y <= maxY)
transform.position = newPosition;
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 82066df26cc71bd46bc0762b0aba7372
timeCreated: 1504643500
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
// Simple script for a test I need to do
@ -9,6 +10,8 @@ public class PlayerController : MonoBehaviour {
public float jumpPower;
public GameObject rocketPrefab;
public Text winText;
// Use this for initialization
void Start () {
@ -29,4 +32,12 @@ public class PlayerController : MonoBehaviour {
rocket.GetComponent<RocketController>().player = this;
}
}
void OnTriggerEnter2D(Collider2D other)
{
//Check the provided Collider2D parameter other to see if it is tagged "PickUp", if it is...
if (other.gameObject.CompareTag ("Finish Line")) {
winText.text = "You Win!";
}
}
}

View file

@ -1 +1 @@
m_EditorVersion: 2017.1.1f1
m_EditorVersion: 2017.1.0f3

View file

@ -3,7 +3,8 @@
--- !u!78 &1
TagManager:
serializedVersion: 2
tags: []
tags:
- Finish Line
layers:
- Default
- TransparentFX