Commit d9bba413 authored by Andrew Van Buren's avatar Andrew Van Buren

GameObject/Create Follow Path

parent 1a6a7e32
fileFormatVersion: 2
guid: c777054cc540bec4986e62a0175b22ef
folderAsset: yes
timeCreated: 1487896545
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
......@@ -6,7 +6,7 @@ public class ToggleEnemy : MonoBehaviour {
Camera cam;
public List<Collider2D> enemies;
List<BaseEnemy> disabledEnemies;
//List<BaseEnemy> disabledEnemies;
// Use this for initialization
void Start () {
......@@ -22,7 +22,7 @@ public class ToggleEnemy : MonoBehaviour {
//check if enemy is in view of camera and disable if not
if (!GeometryUtility.TestPlanesAABB(camPlanes, enemies[i].bounds))
{
enemies[i].gameObject.GetComponent<BaseEnemy>().enabled = false;
//enemies[i].gameObject.GetComponent<BaseEnemy>().enabled = false;
enemies.Remove(enemies[i]);
}
}
......
fileFormatVersion: 2
guid: 6a2550b29bc351342a33bda912bbe294
timeCreated: 1487896545
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a707327fed739e346b5480ab597dbb23
timeCreated: 1487896545
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class FollowPath : MonoBehaviour {
[MenuItem("GameObject/Create Followable Path", false, 10)]
static void CreateCustomGameObject(MenuCommand menuCommand) {
// Create a custom game object
GameObject go = new GameObject("Follow Path");
go.AddComponent<LineRenderer>();
// Ensure it gets reparented if this was a context click (otherwise does nothing)
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
// Register the creation in the undo system
Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
Selection.activeObject = go;
}
}
fileFormatVersion: 2
guid: eca31d3cff9f7a541818958ad4851b14
timeCreated: 1487896640
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -10,7 +10,7 @@ public class WinTrigger : MonoBehaviour {
if(other.gameObject.name == "Player") //ensuring it's the player
{
//tell manager it has won
GameEditor.Win();
//GameEditor.Win();
//Debug.Log("Victory Achieved");
}
}
......
m_EditorVersion: 5.5.0f3
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