Large diffs are not rendered by default.

@@ -19,7 +19,6 @@ public class NPC_Movement : MonoBehaviour
private Vector2 maxWalkPoint;

public Collider2D walkzone;
private Vector3 moveDirection = Vector3.zero;

private int walkDir;
// Use this for initialization
@@ -161,3 +160,5 @@ public void getDir()
}
}



@@ -23,6 +23,7 @@ private void OnTriggerEnter2D(Collider2D collider)
if (spriteRenderer.sprite == sprite1)
{
spriteRenderer.sprite = sprite2;
ScoreScript.scoreValue += 1;
}
}
}
@@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ScoreScript : MonoBehaviour {

public static int scoreValue = 0;
Text score;

// Use this for initialization
void Start () {
score = GetComponent<Text>();
}

// Update is called once per frame
void Update () {
score.text = "INFECTED PEOPLE: " + scoreValue;
}
}
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class capsulecol : MonoBehaviour {

private SpriteRenderer sr;

private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.tag == "Sneeze")
{
sr = GetComponentInParent<SpriteRenderer>();

if (sr.sprite == GetComponentInParent<hazmatMaster>().sprite1)
{
sr.sprite = GetComponentInParent<hazmatMaster>().sprite2;
// isWalking = false; // Does not freeze hazmat
}

}
}
}
@@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class cleanable : MonoBehaviour {

public bool clean;

void Start () {
clean = false;
StartCoroutine(wait());
}


IEnumerator wait()
{
yield return new WaitForSeconds(2f);
clean = true;
}
}
@@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class cleansnot : MonoBehaviour {

private void OnTriggerStay2D(Collider2D collision)
{
if (collision.tag == "Sneeze")
{
Destroy(collision.gameObject);

}


}
}
@@ -0,0 +1,192 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class hazmatMaster : MonoBehaviour
{
public Sprite sprite1;
public Sprite sprite2;
private SpriteRenderer spriteRenderer;

public float speed;

private Rigidbody2D myRigidBody;

public bool isWalking;
private bool hasWalkZone;
public float walkTime;
public float waitTime;
private float walkCounter;
private float waitCounter;
private Vector2 minWalkPoint;
private Vector2 maxWalkPoint;

public Collider2D walkzone;
private Vector3 moveDirection = Vector3.zero;

private int walkDir;
public bool chasing;
// Use this for initialization
void Start()
{
myRigidBody = GetComponent<Rigidbody2D>();

waitCounter = waitTime;
walkCounter = walkTime;

getDir();

spriteRenderer = GetComponent<SpriteRenderer>();
spriteRenderer.sprite = sprite1;

if (walkzone != null)
{
minWalkPoint = walkzone.bounds.min;
maxWalkPoint = walkzone.bounds.max;
hasWalkZone = true;
}
chasing = false;
}

// Update is called once per frame
void Update()
{


if (isWalking)
{
if (chasing == false)
{
walkCounter -= Time.deltaTime;

switch (walkDir)
{
case 0:
//move up
myRigidBody.velocity = new Vector2(0, speed);
//checks y pos compated to bounded y
if (hasWalkZone && transform.position.y > maxWalkPoint.y)
{
isWalking = false;
waitCounter = waitTime;
}
break;
case 1:
//move up and to the right
myRigidBody.velocity = new Vector2(speed, speed);
//checks y compred to max bounded y or x compared to max bounded x
if (hasWalkZone && transform.position.y > maxWalkPoint.y || transform.position.x > maxWalkPoint.x)
{
isWalking = false;
waitCounter = waitTime;
}
break;
case 2:
////move to the right
myRigidBody.velocity = new Vector2(speed, 0);
//checks x compared to max bounded x
if (hasWalkZone && transform.position.x > maxWalkPoint.x)
{
isWalking = false;
waitCounter = waitTime;
}
break;
case 3:
//move down and to the right
myRigidBody.velocity = new Vector2(speed, (speed * -1));
//checks y compared to min bounded y or x compared to max bounded x
if (hasWalkZone && transform.position.y < minWalkPoint.y || transform.position.x > maxWalkPoint.x)
{
isWalking = false;
waitCounter = waitTime;
}
break;
case 4:
//move down
myRigidBody.velocity = new Vector2(0, (speed * -1));
//checks y compared to min bounded y
if (hasWalkZone && transform.position.y < minWalkPoint.y)
{
isWalking = false;
waitCounter = waitTime;
}
break;
case 5:
//move down and to the left
myRigidBody.velocity = new Vector2((speed * -1), (speed * -1));
//checks y compared to min bounded y or x compared to min bounded x
if (hasWalkZone && transform.position.y < minWalkPoint.y || transform.position.x < minWalkPoint.x)
{
isWalking = false;
waitCounter = waitTime;
}
break;
case 6:
//move left
myRigidBody.velocity = new Vector2((speed * -1), 0);
//check x compared to min bounded x
if (hasWalkZone && transform.position.x < minWalkPoint.x)
{
isWalking = false;
waitCounter = waitTime;
}
break;
case 7:
//move up and to the left
myRigidBody.velocity = new Vector2((speed * -1), speed);
//checks y compared to max bounded y or x compared to min bounded x
if (hasWalkZone && transform.position.y > maxWalkPoint.y || transform.position.x < minWalkPoint.x)
{
isWalking = false;
waitCounter = waitTime;
}
break;
}


transform.up = myRigidBody.velocity.normalized;

if (walkCounter < 0)
{
isWalking = false;
waitCounter = waitTime;
}
}
if (spriteRenderer.sprite == sprite2)
{
isWalking = false;
StartCoroutine(sneezed());
}
}
else
{
if (chasing == false)
{
waitCounter -= Time.deltaTime;

myRigidBody.velocity = Vector2.zero;

if (waitCounter < 0)
{
getDir();
}
}
}
}

public void getDir()
{
walkDir = Random.Range(0, 8);
isWalking = true;
walkCounter = walkTime;
}


IEnumerator sneezed()
{
yield return new WaitForSeconds(3f);
spriteRenderer.sprite = sprite1;
}

}

@@ -0,0 +1,55 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class sneezedetect : MonoBehaviour {

private bool chase;
private Collider2D fuck;
private char select;

private void Start()
{
chase = false;
}

private void OnTriggerStay2D(Collider2D collision)
{

if (collision.tag == "Sneeze")
{
if(collision.gameObject.GetComponent<cleanable>().clean)
{
fuck = collision;
chase = true;
select = 'a';
}

}
else if (collision.tag == "Player")
{
fuck = collision;
chase = true;
select = 'b';

}


}
private void Update()
{
if (chase && fuck != null)
{
GetComponentInParent<hazmatMaster>().chasing = true;
GetComponentInParent<Rigidbody2D>().position = Vector2.MoveTowards(GetComponentInParent<Rigidbody2D>().transform.position, fuck.gameObject.GetComponent<Rigidbody2D>().transform.position, .05f);
chase = false;
}
else
{
chase = false;
GetComponentInParent<hazmatMaster>().chasing = false;
}

}

}
@@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class winLoseCondition : MonoBehaviour {

public int totalNPCs;
//private NPCcontroller infectedNPCs;

private Image gameWin;

// Use this for initialization
void Start () {
gameWin = gameObject.GetComponent<Image>();
}

// Update is called once per frame
void Update () {
if (totalNPCs == ScoreScript.scoreValue)
{
gameWin.enabled = true;
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -76,10 +76,17 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Scripts\camerafollow.cs" />
<Compile Include="Assets\Scripts\capsulecol.cs" />
<Compile Include="Assets\Scripts\cleanable.cs" />
<Compile Include="Assets\Scripts\cleansnot.cs" />
<Compile Include="Assets\Scripts\hazmatMaster.cs" />
<Compile Include="Assets\Scripts\NPC_Movement.cs" />
<Compile Include="Assets\Scripts\NPCcontroller.cs" />
<Compile Include="Assets\Scripts\PlayerController.cs" />
<Compile Include="Assets\Scripts\ScoreScript.cs" />
<Compile Include="Assets\Scripts\selfdestructsneeze.cs" />
<Compile Include="Assets\Scripts\sneezedetect.cs" />
<Compile Include="Assets\Scripts\winLoseCondition.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="GenerateTargetFrameworkMonikerAttribute" />
@@ -109,7 +109,7 @@ MonoBehaviour:
m_MinSize: {x: 683, y: 492}
m_MaxSize: {x: 14004, y: 14042}
vertical: 0
controlID: 65
controlID: 67
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -133,7 +133,7 @@ MonoBehaviour:
m_MinSize: {x: 406, y: 492}
m_MaxSize: {x: 10002, y: 14042}
vertical: 1
controlID: 66
controlID: 68
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -153,11 +153,11 @@ MonoBehaviour:
x: 0
y: 0
width: 1465
height: 577
height: 581
m_MinSize: {x: 406, y: 221}
m_MaxSize: {x: 8006, y: 4021}
vertical: 0
controlID: 67
controlID: 12
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -174,19 +174,19 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1060
height: 577
width: 1065
height: 581
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 12}
m_ActualView: {fileID: 13}
m_Panes:
- {fileID: 13}
- {fileID: 12}
- {fileID: 14}
- {fileID: 15}
- {fileID: 16}
m_Selected: 1
m_LastSelected: 0
m_Selected: 0
m_LastSelected: 1
--- !u!114 &9
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -201,10 +201,10 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 1060
x: 1065
y: 0
width: 405
height: 577
width: 400
height: 581
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 17}
@@ -227,9 +227,9 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 577
y: 581
width: 1465
height: 370
height: 366
m_MinSize: {x: 232, y: 271}
m_MaxSize: {x: 10002, y: 10021}
m_ActualView: {fileID: 18}
@@ -256,8 +256,8 @@ MonoBehaviour:
y: 0
width: 455
height: 947
m_MinSize: {x: 277, y: 71}
m_MaxSize: {x: 4002, y: 4021}
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 20}
m_Panes:
- {fileID: 20}
@@ -287,8 +287,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 92
width: 1058
height: 556
width: 1063
height: 560
m_MaximizeOnPlay: 0
m_Gizmos: 0
m_Stats: 0
@@ -297,10 +297,10 @@ MonoBehaviour:
m_ZoomArea:
m_HRangeLocked: 0
m_VRangeLocked: 0
m_HBaseRangeMin: -529
m_HBaseRangeMax: 529
m_VBaseRangeMin: -269.5
m_VBaseRangeMax: 269.5
m_HBaseRangeMin: -531.5
m_HBaseRangeMax: 531.5
m_VBaseRangeMin: -271.5
m_VBaseRangeMax: 271.5
m_HAllowExceedBaseRangeMin: 1
m_HAllowExceedBaseRangeMax: 1
m_VAllowExceedBaseRangeMin: 1
@@ -309,33 +309,33 @@ MonoBehaviour:
m_HSlider: 0
m_VSlider: 0
m_IgnoreScrollWheelUntilClicked: 0
m_EnableMouseInput: 1
m_EnableMouseInput: 0
m_EnableSliderZoom: 0
m_UniformScale: 1
m_UpDirection: 1
m_DrawArea:
serializedVersion: 2
x: 0
y: 17
width: 1058
height: 539
width: 1063
height: 543
m_Scale: {x: 1, y: 1}
m_Translation: {x: 529, y: 269.5}
m_Translation: {x: 531.5, y: 271.5}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
m_MarginBottom: 0
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -529
y: -269.5
width: 1058
height: 539
x: -531.5
y: -271.5
width: 1063
height: 543
m_MinimalGUI: 1
m_defaultScale: 1
m_TargetTexture: {fileID: 0}
m_CurrentColorSpace: 0
m_LastWindowPixelSize: {x: 1058, y: 556}
m_LastWindowPixelSize: {x: 1063, y: 560}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 01000000000100000100
@@ -363,17 +363,17 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 92
width: 1058
height: 556
width: 1063
height: 560
m_SceneLighting: 1
lastFramingTime: 1429.3463974240672
lastFramingTime: 3791.2205586469618
m_2DMode: 1
m_isRotationLocked: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: -1.4560183, y: -0.9527509, z: 14.440929}
m_Target: {x: -3.22832, y: 0.06027733, z: 14.441406}
speed: 2
m_Value: {x: -1.4560183, y: -0.9527509, z: 14.440929}
m_Value: {x: -3.22832, y: 0.06027733, z: 14.441406}
m_RenderMode: 0
m_ValidateTrueMetals: 0
m_SceneViewState:
@@ -400,9 +400,9 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 29.538296
m_Target: 11.629746
speed: 2
m_Value: 29.538296
m_Value: 11.629746
m_Ortho:
m_Target: 1
speed: 2
@@ -533,15 +533,15 @@ MonoBehaviour:
m_DepthBufferBits: 0
m_Pos:
serializedVersion: 2
x: 1062
x: 1067
y: 92
width: 401
height: 556
width: 396
height: 560
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 18fcffff
m_LastClickedID: -1000
m_ExpandedIDs: 1afcffff00000000
m_SelectedIDs: 60050000
m_LastClickedID: 0
m_ExpandedIDs: bcf6fffff0fbffff00000000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -587,9 +587,9 @@ MonoBehaviour:
m_Pos:
serializedVersion: 2
x: 0
y: 669
y: 673
width: 1463
height: 349
height: 345
m_SearchFilter:
m_NameFilter:
m_ClassNames: []
@@ -612,9 +612,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 22260000
m_LastClickedID: 9762
m_ExpandedIDs: 00000000182600005027000000ca9a3bffffff7f
m_SelectedIDs: 4c260000
m_LastClickedID: 9804
m_ExpandedIDs: 000000004026000050260000ba27000000ca9a3bffffff7f
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -642,7 +642,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 000000001826000050270000
m_ExpandedIDs: 000000004026000050260000ba270000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -670,7 +670,7 @@ MonoBehaviour:
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 1
m_ExpandedInstanceIDs: c6230000782c0000862c000066260000
m_ExpandedInstanceIDs: c6230000782c0000862c00006626000000000000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -720,9 +720,9 @@ MonoBehaviour:
m_Pos:
serializedVersion: 2
x: 0
y: 669
y: 673
width: 1463
height: 349
height: 345
--- !u!114 &20
MonoBehaviour:
m_ObjectHideFlags: 52
BIN +156 Bytes (100%) Library/InspectorExpandedItems.asset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN +8.9 KB (100%) Library/assetDatabase3
Binary file not shown.
BIN +12 Bytes (100%) Library/expandedItems
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,6 @@
Base path: C:/Program Files/Unity/Editor/Data
Cmd: initializeCompiler
Cmd: compileSnippet
api=4 type=0 insize=2012 outsize=834 kw= pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME ok=1
Cmd: compileSnippet
api=4 type=1 insize=2012 outsize=666 kw= pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME ok=1
@@ -8,6 +8,7 @@ TagManager:
- Sneeze
- boundaries
- npc
- hazmat
layers:
- Default
- TransparentFX
Binary file not shown.