Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light switch #5

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
52b3c2e
create ExScene
alonp13 Dec 27, 2020
ead4872
Merge pull request #1 from Game-Dev-Project-D-A-Y/Player-part2
alonp13 Dec 27, 2020
6b005c9
kara
YishayGarame Dec 27, 2020
fb81ce8
Merge branch 'master' of https://github.com/Game-Dev-Project-D-A-Y/06…
YishayGarame Dec 27, 2020
cc30c60
Create packages-lock.json
YishayGarame Dec 27, 2020
44ded9c
Merge branch 'master' into player-part1
YishayGarame Dec 27, 2020
44cce13
fast speed added
YishayGarame Dec 27, 2020
e12e270
Merge pull request #2 from Game-Dev-Project-D-A-Y/player-part1
YishayGarame Dec 27, 2020
1ff85b7
added lamps
doviec Dec 27, 2020
d05e31e
Merge branch 'master' into Light-switch
doviec Dec 27, 2020
45029c0
before import
alonp13 Dec 27, 2020
61d80c4
finish grenade without explosion
alonp13 Dec 27, 2020
f95c8f0
Update ExScene.unity
alonp13 Dec 27, 2020
9bee0b9
Merge pull request #3 from Game-Dev-Project-D-A-Y/Player-part2
alonp13 Dec 27, 2020
03fa6d2
Update ExScene.unity
alonp13 Dec 27, 2020
7b2882d
added lights by switch
doviec Dec 27, 2020
d0c7d3d
Merge branch 'master' into Light-switch
alonp13 Dec 27, 2020
790d94c
Merge pull request #4 from Game-Dev-Project-D-A-Y/Light-switch
alonp13 Dec 27, 2020
5ed980b
Revert "Update ExScene.unity"
alonp13 Dec 27, 2020
440fb2c
Revert "Update ExScene.unity"
alonp13 Dec 27, 2020
d2e9713
Merge branch 'master' into Player-part2
alonp13 Dec 27, 2020
0cb9796
Merge pull request #5 from Game-Dev-Project-D-A-Y/Player-part2
alonp13 Dec 27, 2020
e322951
Revert "Update ExScene.unity"
alonp13 Dec 27, 2020
54c8185
Revert "Update ExScene.unity"
alonp13 Dec 27, 2020
4400f45
added grenade
doviec Dec 27, 2020
6ff8247
Merge pull request #6 from Game-Dev-Project-D-A-Y/Light-switch
doviec Dec 27, 2020
1aee9d5
Merge branch 'master' into Player-part2
alonp13 Dec 27, 2020
688b36e
Update ExScene.unity
alonp13 Dec 27, 2020
0fa40e3
Merge pull request #7 from Game-Dev-Project-D-A-Y/Player-part2
alonp13 Dec 27, 2020
7674add
Update ExScene.unity
doviec Dec 27, 2020
3ff9021
lights all over
doviec Dec 27, 2020
c829997
Engine enemy
alonp13 Dec 27, 2020
8d4f0c8
enemy engine
alonp13 Dec 27, 2020
177093f
Merge branch 'master' into Light-switch
doviec Dec 27, 2020
41ae658
0
doviec Dec 27, 2020
c233e3e
Update ExScene.unity
doviec Dec 27, 2020
ac45687
please work
doviec Dec 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,7 @@ $RECYCLE.BIN/

# Pycharm project
.idea
Assets/Scenes/4-ai/ExScene.meta
Assets/Prefabs/EnemyEngine.prefab.meta
Assets/Scenes/4-ai/ExScene/NavMesh.asset.meta
Assets/Scenes/4-ai/ExScene/NavMesh.asset.meta
56 changes: 56 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"files.exclude":
{
"**/.DS_Store":true,
"**/.git":true,
"**/.gitignore":true,
"**/.gitmodules":true,
"**/*.booproj":true,
"**/*.pidb":true,
"**/*.suo":true,
"**/*.user":true,
"**/*.userprefs":true,
"**/*.unityproj":true,
"**/*.dll":true,
"**/*.exe":true,
"**/*.pdf":true,
"**/*.mid":true,
"**/*.midi":true,
"**/*.wav":true,
"**/*.gif":true,
"**/*.ico":true,
"**/*.jpg":true,
"**/*.jpeg":true,
"**/*.png":true,
"**/*.psd":true,
"**/*.tga":true,
"**/*.tif":true,
"**/*.tiff":true,
"**/*.3ds":true,
"**/*.3DS":true,
"**/*.fbx":true,
"**/*.FBX":true,
"**/*.lxo":true,
"**/*.LXO":true,
"**/*.ma":true,
"**/*.MA":true,
"**/*.obj":true,
"**/*.OBJ":true,
"**/*.asset":true,
"**/*.cubemap":true,
"**/*.flare":true,
"**/*.mat":true,
"**/*.meta":true,
"**/*.prefab":true,
"**/*.unity":true,
"build/":true,
"Build/":true,
"Library/":true,
"library/":true,
"obj/":true,
"Obj/":true,
"ProjectSettings/":true,
"temp/":true,
"Temp/":true
}
}
42 changes: 42 additions & 0 deletions Assets/EngineRunner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using UnityEngine;
using UnityEngine.AI;


/**
* This component represents an NPC that runs randomly between targets.
* The targets are all the objects with a Target component.
*/
[RequireComponent(typeof(NavMeshAgent))]
public class EngineRunner: MonoBehaviour {

[SerializeField] Transform engine;

private NavMeshAgent navMeshAgent;
private Animator animator;
private float rotationSpeed = 5f;

private void Start() {
navMeshAgent = GetComponent<NavMeshAgent>();
animator = GetComponent<Animator>();

SelectNewTarget();
}

private void SelectNewTarget() {
navMeshAgent.SetDestination(engine.position);
}


private void Update() {
if (navMeshAgent.hasPath) {
FaceDestination();
}
}

private void FaceDestination() {
Vector3 directionToDestination = (navMeshAgent.destination - transform.position).normalized;
Quaternion lookRotation = Quaternion.LookRotation(new Vector3(directionToDestination.x, 0, directionToDestination.z));
//transform.rotation = lookRotation; // Immediate rotation
transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, Time.deltaTime * rotationSpeed); // Gradual rotation
}
}
11 changes: 11 additions & 0 deletions Assets/EngineRunner.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions Assets/GrenadeScript.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GrenadeScript : MonoBehaviour
{
[SerializeField] GameObject explosionEffect;
[SerializeField] float delay = 3f;
[SerializeField] float explosionForce = 10f;
[SerializeField] float radius = 20f;

private float startingTime;
// Start is called before the first frame update
void Start()
{
startingTime = Time.deltaTime;
}

void Update()
{
startingTime += Time.deltaTime;
if(startingTime >= delay)
{
Explode();
}
}

// Update is called once per frame

private void Explode()
{
Collider[] colliders = Physics.OverlapSphere(transform.position, radius);

foreach(Collider near in colliders)
{
if(near.tag == "Enemy") {
Debug.Log(near.name+" is DEAD!");
Destroy(near.gameObject);
}
}
//Instantiate(explosionEffect,transform.position,transform.rotation);
Destroy(gameObject);
}
}
11 changes: 11 additions & 0 deletions Assets/GrenadeScript.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Lamps.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/Lamps/Meshes.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/Lamps/Meshes/Materials.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions Assets/Lamps/Meshes/Materials/parquet_diffuse.mat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Assets/Lamps/Meshes/Materials/parquet_diffuse.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions Assets/Lamps/Meshes/Materials/standing_lamp1.mat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Assets/Lamps/Meshes/Materials/standing_lamp1.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading