parent
521a62973a
commit
8e077e523c
278 changed files with 0 additions and 11344 deletions
|
@ -1,39 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class BoomLazer : MonoBehaviour
|
||||
{
|
||||
private float i = 0.0f;
|
||||
Rigidbody rib;
|
||||
[SerializeField] float explosionRadius;
|
||||
[SerializeField] float explosionForce;
|
||||
private float upwardModifier = 0.0f;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
private void Start()
|
||||
{
|
||||
rib=GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
|
||||
//Prend tout les rigidbody sauf le sien et leurs applique une force pour les expulser
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
//Uniformisation des codes de balles, pour la détruire au 2e impact avec un collider dû au fait qu'elle spawn DANS un collider
|
||||
//Reste clairement Junky et est sujet à amélioration
|
||||
i += 1;
|
||||
if (i > 0)
|
||||
{
|
||||
Vector3 explosionPosition = transform.position;
|
||||
Collider[] colliders = Physics.OverlapSphere(explosionPosition, explosionRadius);
|
||||
|
||||
foreach (Collider collider in colliders)
|
||||
{
|
||||
Rigidbody rb = collider.GetComponent<Rigidbody>();
|
||||
if (rb != null & rb != rib)
|
||||
{
|
||||
rb.AddExplosionForce(explosionForce, explosionPosition, explosionRadius, upwardModifier, ForceMode.Impulse);
|
||||
}
|
||||
}
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 30612f05fd9747843853fc490546942a
|
|
@ -1,101 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class CameraFly : MonoBehaviour
|
||||
{
|
||||
[SerializeField] float mainSpeed; //regular speed
|
||||
[SerializeField] float shiftAdd; //multiplied by how long shift is held. Basically running
|
||||
[SerializeField] float maxShift; //Maximum speed when holdin gshift
|
||||
[SerializeField] float camVelocity; //How sensitive it with mouse
|
||||
private Vector3 lastMouse = new Vector3(255, 255, 255); //kind of in the middle of the screen, rather than at the top (play)
|
||||
private float totalRun = 1.0f;
|
||||
|
||||
void Update()
|
||||
{
|
||||
Vector3 r = GetRotInput();
|
||||
lastMouse = new Vector3(transform.eulerAngles.x + r.x, transform.eulerAngles.y + r.y, 0);
|
||||
//transform.eulerAngles = lastMouse;
|
||||
transform.rotation = Quaternion.Euler(lastMouse);
|
||||
//Mouse camera angle done.
|
||||
|
||||
//Keyboard commands
|
||||
//float f = 0.0f;
|
||||
Vector3 p = GetBaseInput();
|
||||
if (p.sqrMagnitude > 0)
|
||||
{ // only move while a direction key is pressed
|
||||
if (Input.GetKey(KeyCode.LeftShift))
|
||||
{
|
||||
totalRun += Time.deltaTime;
|
||||
p = p * totalRun * shiftAdd;
|
||||
p.x = Mathf.Clamp(p.x, -maxShift, maxShift);
|
||||
p.y = Mathf.Clamp(p.y, -maxShift, maxShift);
|
||||
p.z = Mathf.Clamp(p.z, -maxShift, maxShift);
|
||||
}
|
||||
else
|
||||
{
|
||||
totalRun = Mathf.Clamp(totalRun * 0.5f, 1f, 1000f);
|
||||
p = p * mainSpeed;
|
||||
}
|
||||
|
||||
p = p * Time.deltaTime;
|
||||
Vector3 newPosition = transform.position;
|
||||
if (Input.GetKey(KeyCode.Space))
|
||||
{ //If player wants to move on X and Z axis only
|
||||
transform.Translate(p);
|
||||
newPosition.x = transform.position.x;
|
||||
newPosition.z = transform.position.z;
|
||||
transform.position = newPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
transform.Translate(p);
|
||||
}
|
||||
}
|
||||
Debug.Log(r);
|
||||
Debug.Log(p);
|
||||
}
|
||||
|
||||
private Vector3 GetBaseInput()
|
||||
{ //returns the basic values, if it's 0 than it's not active.
|
||||
Vector3 p_Velocity = new Vector3();
|
||||
if (Input.GetKey(KeyCode.UpArrow))
|
||||
{
|
||||
p_Velocity += new Vector3(0, 0, 1);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.DownArrow))
|
||||
{
|
||||
p_Velocity += new Vector3(0, 0, -1);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.LeftArrow))
|
||||
{
|
||||
p_Velocity += new Vector3(-1, 0, 0);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.RightArrow))
|
||||
{
|
||||
p_Velocity += new Vector3(1, 0, 0);
|
||||
}
|
||||
return p_Velocity;
|
||||
}
|
||||
|
||||
private Vector3 GetRotInput()
|
||||
{ //returns the basic values, if it's 0 than it's not active.
|
||||
Vector3 r_Velocity = new Vector3();
|
||||
if (Input.GetKey(KeyCode.Z))
|
||||
{
|
||||
r_Velocity += new Vector3(0, 1,0);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.S))
|
||||
{
|
||||
r_Velocity += new Vector3(0, -1, 0);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.Q))
|
||||
{
|
||||
r_Velocity += new Vector3(-1, 0, 0);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.D))
|
||||
{
|
||||
r_Velocity += new Vector3(1, 0, 0);
|
||||
}
|
||||
return camVelocity*r_Velocity;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5c1167af3b3e2714d8cfcbaaf894d1ed
|
|
@ -1,73 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class CameraMovement : MonoBehaviour
|
||||
{
|
||||
[SerializeField] float cameraMovementSpeed;
|
||||
[SerializeField] float cameraRotationSpeed;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
//avancer reculer
|
||||
if (Input.GetKey(KeyCode.UpArrow))
|
||||
{
|
||||
Debug.Log("avancer");
|
||||
transform.Translate(Vector3.forward * Time.deltaTime * cameraMovementSpeed);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.DownArrow))
|
||||
{
|
||||
Debug.Log("reculer");
|
||||
transform.Translate(-Vector3.forward * Time.deltaTime * cameraMovementSpeed);
|
||||
}
|
||||
if (Input.GetKey("w"))
|
||||
{
|
||||
Debug.Log("lever la tête");
|
||||
transform.Rotate(-cameraRotationSpeed * Time.deltaTime, 0.0f, 0.0f, Space.Self);
|
||||
}
|
||||
else if (Input.GetKey("s"))
|
||||
{
|
||||
Debug.Log("baisser la tête");
|
||||
transform.Rotate(cameraRotationSpeed * Time.deltaTime, 0.0f, 0.0f, Space.Self);
|
||||
}
|
||||
else if (Input.GetKey("a"))
|
||||
{
|
||||
Debug.Log("tourner la tête à gauche");
|
||||
transform.Rotate(0.0f, -cameraRotationSpeed * Time.deltaTime, 0.0f, Space.Self);
|
||||
}
|
||||
else if (Input.GetKey("d"))
|
||||
{
|
||||
Debug.Log("tourner la tête à droite");
|
||||
transform.Rotate(0.0f, cameraRotationSpeed * Time.deltaTime, 0.0f, Space.Self);
|
||||
}
|
||||
Debug.Log(transform.rotation);
|
||||
|
||||
/*
|
||||
if (Input.GetKey("a") || Input.GetKey(KeyCode.LeftArrow))
|
||||
{
|
||||
Debug.Log("Moving Left");
|
||||
transform.localPosition += new Vector3(-lateralSpeed, 0.0f, 0.0f);
|
||||
}
|
||||
if (Input.GetKey("d") || Input.GetKey(KeyCode.RightArrow))
|
||||
{
|
||||
Debug.Log("Moving Right");
|
||||
transform.localPosition += new Vector3(lateralSpeed, 0.0f, 0.0f);
|
||||
}
|
||||
if (Input.GetKey("w") || Input.GetKey(KeyCode.LeftArrow))
|
||||
{
|
||||
Debug.Log("Moving Up");
|
||||
transform.localPosition += new Vector3(-lateralSpeed, 0.0f, 0.0f);
|
||||
}
|
||||
if (Input.GetKey("s") || Input.GetKey(KeyCode.RightArrow))
|
||||
{
|
||||
Debug.Log("Moving Down");
|
||||
transform.localPosition += new Vector3(lateralSpeed, 0.0f, 0.0f);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bb4cb9778ceb34cd9a78060f8717e2e0
|
|
@ -1,38 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class CameraMovementFlat : MonoBehaviour
|
||||
{
|
||||
[SerializeField] float cameraMovementSpeed;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
//avancer reculer
|
||||
if (Input.GetKey(KeyCode.UpArrow))
|
||||
{
|
||||
//Debug.Log("avancer");
|
||||
transform.Translate(Vector3.forward * Time.deltaTime * cameraMovementSpeed, Space.World);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.DownArrow))
|
||||
{
|
||||
//Debug.Log("reculer");
|
||||
transform.Translate(-Vector3.forward * Time.deltaTime * cameraMovementSpeed, Space.World);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.LeftArrow))
|
||||
{
|
||||
//Debug.Log("gauche");
|
||||
transform.Translate(-Vector3.right * Time.deltaTime * cameraMovementSpeed, Space.World);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.RightArrow))
|
||||
{
|
||||
//Debug.Log("droite");
|
||||
transform.Translate(Vector3.right * Time.deltaTime * cameraMovementSpeed, Space.World);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 925cd4cabe50f39309d22502c750e5a7
|
|
@ -1,47 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class Duck : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] protected float baseMovementSpeed;
|
||||
[SerializeField] protected int baseHP;
|
||||
[SerializeField] protected int baseArmor;
|
||||
|
||||
|
||||
[SerializeField] protected float baseAttackSpeed;
|
||||
[SerializeField] protected int manaToSpecialAttack;
|
||||
[SerializeField] protected Weapon weapon;
|
||||
|
||||
protected float currentMovementSpeed;
|
||||
protected int currentHP;
|
||||
protected int currentArmor;
|
||||
protected float currentAttackSpeed;
|
||||
|
||||
|
||||
//TODO WEAPON
|
||||
//TODO Special Ability
|
||||
|
||||
public virtual void activateSpecialAbility(){
|
||||
|
||||
}
|
||||
|
||||
public virtual void takeDamage(int damage){
|
||||
currentHP -= (damage > currentArmor) ? (damage - currentArmor) : 0;
|
||||
}
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
currentMovementSpeed = baseMovementSpeed;
|
||||
currentHP = baseHP;
|
||||
currentArmor = baseArmor;
|
||||
currentAttackSpeed = baseAttackSpeed;
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: faa3fb39c1a2816728c5f5ab89a77e88
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 729b67aec8bf08c9cb3b3ca6fff99f98
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 660b916d2bd6edd46ad63fa30ab00bf7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,23 +0,0 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
public class NavMeshJunk : MonoBehaviour
|
||||
{
|
||||
private NavMeshAgent agent;
|
||||
[SerializeField] Vector3 destination;
|
||||
[SerializeField] GameObject Arriv;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
agent = GetComponent<NavMeshAgent>();
|
||||
destination = agent.destination;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
destination=Arriv.transform.position;
|
||||
agent.destination = destination;
|
||||
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: adb0192ce72ebe549a6c031fa82c92a7
|
|
@ -1,37 +0,0 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PVMETER : MonoBehaviour
|
||||
{
|
||||
[SerializeField] Image PVMeter;
|
||||
private float PVm;
|
||||
private float PVMax;
|
||||
public Gradient colorGradient;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Debug.Log("JE SUIS LA");
|
||||
var gradient = new Gradient();
|
||||
|
||||
var colors = new GradientColorKey[2];
|
||||
colors[0] = new GradientColorKey(Color.red, 0.0f);
|
||||
colors[1] = new GradientColorKey(Color.green, 1.0f);
|
||||
|
||||
var alphas = new GradientAlphaKey[2];
|
||||
alphas[0] = new GradientAlphaKey(1.0f, 0.0f);
|
||||
alphas[1] = new GradientAlphaKey(1.0f, 0.0f);
|
||||
|
||||
gradient.SetKeys(colors, alphas);
|
||||
|
||||
PVm = GetComponent<BaseDuckScript>().getHealth() / GetComponent<BaseDuckScript>().getBaseHealth();
|
||||
Debug.Log(PVm);
|
||||
PVMeter.fillAmount = PVm;
|
||||
PVMeter.color = colorGradient.Evaluate(PVm);
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cb0f365017cf19b4899eac2e66eecafb
|
|
@ -1,53 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class PlayerJunkMVT : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
var gradient = new Gradient();
|
||||
|
||||
// Blend color from red at 0% to blue at 100%
|
||||
var colors = new GradientColorKey[2];
|
||||
colors[0] = new GradientColorKey(Color.red, 0.0f);
|
||||
colors[1] = new GradientColorKey(Color.green, 1.0f);
|
||||
|
||||
// Blend alpha from opaque at 0% to transparent at 100%
|
||||
var alphas = new GradientAlphaKey[2];
|
||||
alphas[0] = new GradientAlphaKey(1.0f, 0.0f);
|
||||
alphas[1] = new GradientAlphaKey(1.0f, 0.0f);
|
||||
|
||||
gradient.SetKeys(colors, alphas);
|
||||
|
||||
// What's the color at the relative time 0.25 (25%) ?
|
||||
Debug.Log(gradient.Evaluate(0.25f));
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
float SPEED = 10.0f;
|
||||
float ROT = 100.0f;
|
||||
if (Input.GetKey(KeyCode.UpArrow))
|
||||
{
|
||||
Debug.Log("avancer");
|
||||
transform.Translate(Vector3.forward * Time.deltaTime * SPEED);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.DownArrow))
|
||||
{
|
||||
Debug.Log("reculer");
|
||||
transform.Translate(-Vector3.forward * Time.deltaTime * SPEED);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.LeftArrow))
|
||||
{
|
||||
Debug.Log("tourner la tête à gauche");
|
||||
transform.Rotate(0.0f, -ROT * Time.deltaTime, 0.0f, Space.Self);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.RightArrow))
|
||||
{
|
||||
Debug.Log("tourner la tête à droite");
|
||||
transform.Rotate(0.0f, ROT * Time.deltaTime, 0.0f, Space.Self);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a79444adcfdbaa841878f04f33784edb
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0be1134697c5c3ad582850b7ecb67148
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,6 +0,0 @@
|
|||
//using UnityEngine;
|
||||
|
||||
public interface Weapon
|
||||
{
|
||||
void dealDamage();
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7cedfc101377768d7ad55c639ea2f239
|
Loading…
Add table
Add a link
Reference in a new issue