Skip to content
Snippets Groups Projects
Commit 09eb2144 authored by DI-PIETRO RAFFAEL's avatar DI-PIETRO RAFFAEL
Browse files

Merge branch 'master' of git.unistra.fr:chirz/cityescape into master

parents e01ec840 d42355f5
Branches
No related merge requests found
Showing
with 26248 additions and 11 deletions
...@@ -32,4 +32,4 @@ Thumbs.db ...@@ -32,4 +32,4 @@ Thumbs.db
# VSCode Generated # VSCode Generated
.vscode .vscode
*.log Logs
\ No newline at end of file \ No newline at end of file
fileFormatVersion: 2
guid: 125183781ca307b4c969d7d5d1776eeb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2cf5b91c2bb35274ba22e7444131bb4a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Import/Objects/Verdure/buisson.png

3.5 KiB

fileFormatVersion: 2
guid: 9a3da46151bad6b47a98a789649aebeb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &480113695441922079
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 480113695441922077}
- component: {fileID: 480113695441922078}
- component: {fileID: 480113695441922076}
- component: {fileID: 480113695441922067}
- component: {fileID: 480113695441922066}
m_Layer: 0
m_Name: buisson
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &480113695441922077
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 480113695441922079}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -8.235, y: 1.8392, z: 0}
m_LocalScale: {x: 0.7331367, y: 0.7288515, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &480113695441922078
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 480113695441922079}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 1
m_Sprite: {fileID: 21300000, guid: 9a3da46151bad6b47a98a789649aebeb, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 6, y: 6}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!60 &480113695441922076
PolygonCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 480113695441922079}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 6, y: 6}
newSize: {x: 6, y: 6}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
m_Points:
m_Paths:
- - {x: 0.68, y: -1.81}
- {x: 0.95, y: -1.9699999}
- {x: 1.6899999, y: -1.9599999}
- {x: 1.9799999, y: -1.8199999}
- {x: 2.23, y: -1.5899999}
- {x: 2.3, y: -1.3199999}
- {x: 2.3, y: -0.31}
- {x: 2.18, y: -0.08}
- {x: 1.93, y: 0.14999999}
- {x: 1.56, y: 0.26}
- {x: 1.3399999, y: 0.26}
- {x: 1.36, y: 1.09}
- {x: 1.25, y: 1.23}
- {x: 1.12, y: 1.3299999}
- {x: 1, y: 1.5699999}
- {x: 0.88, y: 1.6999999}
- {x: 0.65999997, y: 1.8199999}
- {x: -0.65999997, y: 1.8199999}
- {x: -0.85999995, y: 1.74}
- {x: -0.97999996, y: 1.5899999}
- {x: -1.3399999, y: 1.11}
- {x: -1.5799999, y: 0.26999998}
- {x: -1.9499999, y: 0.19}
- {x: -2.22, y: -0.089999996}
- {x: -2.3, y: -0.35999998}
- {x: -2.3, y: -1.36}
- {x: -2.18, y: -1.56}
- {x: -2.07, y: -1.6999999}
- {x: -1.9499999, y: -1.8199999}
- {x: -1.68, y: -1.9399999}
- {x: -0.96, y: -1.9399999}
- {x: -0.94, y: -1.92}
- {x: -0.71, y: -1.8399999}
- {x: -0.5, y: -1.6999999}
- {x: -0.65, y: -2.1499999}
- {x: -0.62, y: -2.69}
- {x: -0.39999998, y: -2.8999999}
- {x: 0.41, y: -2.8999999}
- {x: 0.62, y: -2.6399999}
- {x: 0.64, y: -2.1499999}
- {x: 0.51, y: -2.12}
--- !u!70 &480113695441922067
CapsuleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 480113695441922079}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.039261486, y: -1.4295952}
m_Size: {x: 4.131185, y: 4.1554737}
m_Direction: 0
--- !u!114 &480113695441922066
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 480113695441922079}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c2eed50797895184ab44621a154ad526, type: 3}
m_Name:
m_EditorClassIdentifier:
nbPoints: 5
fileFormatVersion: 2
guid: 9cdcd3ac7314fd649bf366c8fd2a4460
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
fileFormatVersion: 2
guid: b45818539c00d614f8e62d9be90b08c7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File moved
fileFormatVersion: 2
guid: bdf7662389bf8487c9a7909d08af8c3e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -6,6 +6,8 @@ public class CameraMouvement : MonoBehaviour ...@@ -6,6 +6,8 @@ public class CameraMouvement : MonoBehaviour
{ {
public Transform target; public Transform target;
public float smoothing; public float smoothing;
public Vector2 maxPosition;
public Vector2 minPosition;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
...@@ -18,6 +20,10 @@ public class CameraMouvement : MonoBehaviour ...@@ -18,6 +20,10 @@ public class CameraMouvement : MonoBehaviour
{ {
if(transform.position != target.position){ if(transform.position != target.position){
Vector3 targetPosition = new Vector3(target.position.x, target.position.y,transform.position.z); Vector3 targetPosition = new Vector3(target.position.x, target.position.y,transform.position.z);
targetPosition.x = Mathf.Clamp(targetPosition.x, minPosition.x, maxPosition.x);
targetPosition.y = Mathf.Clamp(targetPosition.y, minPosition.y, maxPosition.y);
transform.position = Vector3.Lerp(transform.position, targetPosition, smoothing); transform.position = Vector3.Lerp(transform.position, targetPosition, smoothing);
} }
} }
......
fileFormatVersion: 2
guid: 678c8ec8f8e684c46952593351fbb459
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 17ec0e2b89ca0384e9e3ca9418ae3ca4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
/*
* Script par Tanguy Gimenez
*
*/
using UnityEngine;
public class VerdureGestionNature : MonoBehaviour
{
// nombre maximum de points que peut rapporter un élément de verdure
private const int MAX_POINTS = 10;
// nombre de points que rapporte cet objet
public int nbPoints = 0;
void Start()
{
if (nbPoints > MAX_POINTS)
{
Debug.LogError("nbPoints ne peut pas être supérieur à " + MAX_POINTS);
return;
}
}
// Quand le joueur entre en collision avec le joueur => on ajoute les points (au groupe 12 :tirak:)
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
PlayerNature.instance.WinNature(nbPoints);
this.nbPoints = 0;
}
}
}
fileFormatVersion: 2
guid: c2eed50797895184ab44621a154ad526
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections; /*
using System.Collections.Generic; * Script par Valentin Bloch
*
*/
using UnityEngine; using UnityEngine;
public class PlayerMovement : MonoBehaviour public class PlayerMovement : MonoBehaviour
...@@ -18,16 +21,23 @@ public class PlayerMovement : MonoBehaviour ...@@ -18,16 +21,23 @@ public class PlayerMovement : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
change = Vector3.zero; change = Vector3.zero;
change.x = Input.GetAxisRaw("Horizontal"); change.x = Input.GetAxisRaw("Horizontal");
change.y = Input.GetAxisRaw("Vertical"); change.y = Input.GetAxisRaw("Vertical");
if(change != Vector3.zero){ if (change != Vector3.zero)
{
MoveCharacter(); MoveCharacter();
}
}
void MoveCharacter(){
myRigidbody.MovePosition(transform.position + change * speed * Time.deltaTime);
} }
Vector3 pos = Camera.main.WorldToViewportPoint(transform.position);
pos.x = Mathf.Clamp01(pos.x);
pos.y = Mathf.Clamp01(pos.y);
transform.position = Camera.main.ViewportToWorldPoint(pos);
}
void MoveCharacter()
{
myRigidbody.MovePosition(transform.position + change * speed * Time.deltaTime);
}
} }
...@@ -7,28 +7,60 @@ using UnityEngine; ...@@ -7,28 +7,60 @@ using UnityEngine;
public class PlayerNature : MonoBehaviour public class PlayerNature : MonoBehaviour
{ {
// l'instance de PlayerNature (pour un singleton)
public static PlayerNature instance;
// Nombre max de points de nature que le joueur peut avoir (objectif à atteindre)
public int maxNature = 200; public int maxNature = 200;
// Quantité de points actuel
public int currentNature; public int currentNature;
// Jauge de points de nature
public Bar natureBar; public Bar natureBar;
void Start() void Start()
{ {
this.currentNature = this.maxNature/2; this.currentNature = this.maxNature / 2;
this.natureBar.SetMaxNature(this.maxNature); this.natureBar.SetMaxNature(this.maxNature);
} }
// Update is called once per frame
void Update() void Update()
{ {
// DEBUG
if (Input.GetKeyDown(KeyCode.Space)) if (Input.GetKeyDown(KeyCode.Space))
this.LooseNature(1); this.LooseNature(1);
} }
// Perd un certain nombre de points de nature
public void LooseNature(int damage) public void LooseNature(int damage)
{ {
this.currentNature -= damage; this.currentNature -= damage;
this.natureBar.SetValue(this.currentNature);
}
// Gagne un certain nombre de points de nature
public void WinNature(int bonus)
{
this.currentNature += bonus;
this.natureBar.SetValue(this.currentNature); this.natureBar.SetValue(this.currentNature);
} }
// Singleton
private void Awake()
{
if (instance != null)
{
Debug.LogWarning("Il y a + d'une instance de PlayerNature");
return;
}
instance = this;
}
} }
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