Skip to content
Snippets Groups Projects
Commit a7aac604 authored by GIMENEZ TANGUY's avatar GIMENEZ TANGUY
Browse files

Résolution de conflits

parents 9a23d283 4a2fc94e
Branches
No related merge requests found
fileFormatVersion: 2
guid: 5097a5d46361eda43b5a45ce166e49aa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -601,7 +601,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 262, y: -82}
m_AnchoredPosition: {x: 276, y: -82}
m_SizeDelta: {x: 783.7002, y: 106.7631}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6308161532840785029
......@@ -645,7 +645,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: Press space to continue...
m_Text: Press space to continue
--- !u!114 &8222045683807769845
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -658,8 +658,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
m_EffectDistance: {x: 1, y: -1}
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.8235294}
m_EffectDistance: {x: 2, y: -2}
m_UseGraphicAlpha: 1
--- !u!1 &8044393686726401242
GameObject:
......@@ -739,7 +739,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Inventaire
m_Text: Infentaire
--- !u!1 &8451290368213161651
GameObject:
m_ObjectHideFlags: 0
......@@ -802,7 +802,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.44705883}
m_Color: {r: 1, g: 1, b: 1, a: 0.42745098}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
......
......@@ -761,7 +761,7 @@ MonoBehaviour:
city: {fileID: 1075515021}
scene: sceneRaffael
animmator: {fileID: 1460786684}
nom: Dusseldorf
nom: DUSSELDORF
--- !u!4 &1459655252
Transform:
m_ObjectHideFlags: 0
......
This diff is collapsed.
......@@ -45,30 +45,12 @@ public class Dialog : MonoBehaviour
this.dialog = 0;
string[] DialogsStart = {
"Ach... Encore ein gute chournée dans mon fillage!",
string[] DialogsLvl1 = {
"Ach... Encore eine gute chournée dans mon fillage!",
"Ch'ai très enfie te me balader",
"Che defrai aller au Nord dans la forêt ja !"
};
this.ListDialogs.Add("start", DialogsStart);
string[] Dialogsraff = {
"Salut",
"cava ?",
"Je te mange tes morts"
};
this.ListDialogs.Add("pnj", Dialogsraff);
string[] DialogsTest = {
"Je fais un test",
"ca marche ? ou pas ?",
"bisous"
};
this.ListDialogs.Add("test", DialogsTest);
this.ListDialogs.Add("start", DialogsLvl1);
string[] boutiqueChaussure = {
......@@ -124,18 +106,6 @@ public class Dialog : MonoBehaviour
if ((Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown("joystick button 0")) && dialogActive)
this.Next();
// // DEBUG
// if ((Input.GetKeyDown(KeyCode.H) || Input.GetKeyDown("joystick button 1")))
// this.dialogActive = !this.dialogActive;
// // DEBUG
// if (Input.GetKeyDown(KeyCode.F))
// {
// Debug.Log("tut");
// this.setSituation("marchand");
// }
if (this.dialogActive)
{
this.dialogBox.GetComponent<CanvasRenderer>().SetAlpha(1f);
......
......@@ -15,7 +15,7 @@ public class PlayerMovement : MonoBehaviour
{
public float speed;
private Rigidbody2D myRigidbody;
private Vector3 change;
private Vector2 moveDirection;
private Animator animator;
public PlayerState currentState;
public int stage = 0;
......@@ -39,22 +39,52 @@ public class PlayerMovement : MonoBehaviour
// Update is called once per frame
void Update()
{
change = Vector3.zero;
change.x = Input.GetAxisRaw("Horizontal");
change.y = Input.GetAxisRaw("Vertical");
ProcessInputs();
if(currentState == PlayerState.walk)
{
UpdateAnimationAndMove();
}
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);
gameIntelligence();
}
private void FixedUpdate()
{
moveDirection.Normalize();
myRigidbody.velocity = new Vector2(moveDirection.x * speed, moveDirection.y * speed);
}
private void ProcessInputs()
{
float moveX = Input.GetAxisRaw("Horizontal");
float moveY = Input.GetAxisRaw("Vertical");
moveDirection = new Vector2(moveX, moveY);
}
void UpdateAnimationAndMove()
{
if (moveDirection != Vector2.zero)
{
animator.SetFloat("moveX", moveDirection.x);
animator.SetFloat("moveY", moveDirection.y);
animator.SetBool("moving", true);
}
else
{
animator.SetBool("moving", false);
}
}
void gameIntelligence()
{
if (this.GetComponent<PlayerNature>().currentNature >= 100 && stage == 0)
{
GenerateMap.instance.generateBoutique(0, 1, "chaussure");
......@@ -96,26 +126,4 @@ public class PlayerMovement : MonoBehaviour
stage++;
}
}
void MoveCharacter()
{
change.Normalize();
myRigidbody.MovePosition(transform.position + change * speed * Time.deltaTime);
}
void UpdateAnimationAndMove()
{
if (change != Vector3.zero)
{
MoveCharacter();
animator.SetFloat("moveX", change.x);
animator.SetFloat("moveY", change.y);
animator.SetBool("moving", true);
}
else
{
animator.SetBool("moving", false);
}
}
}
......@@ -8,6 +8,8 @@ using System;
using System.Timers;
public class PlayerNature : MonoBehaviour
{
// l'instance de PlayerNature (pour un singleton)
......@@ -39,8 +41,6 @@ public class PlayerNature : MonoBehaviour
}
void Update()
{
......
......@@ -55,6 +55,7 @@ public class Shopping : MonoBehaviour
if ((Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown("joystick button 1")) && playerInRange && sellItem && itemForSale.Count > 0)
{
PlayerNature.instance.LooseNature(25);
switch (sellItem.id)
{
case 1:
......
......@@ -5,7 +5,10 @@ EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
- enabled: 0
path: Assets/Scenes/Niveau1.unity
guid: 2cda990e2423bbf4892e6590ba056729
- enabled: 0
path: Assets/Scenes/Menu.unity
guid: 458707c07ba6b4b4297fc1de6ac38622
- enabled: 1
......@@ -14,10 +17,10 @@ EditorBuildSettings:
- enabled: 1
path: Assets/Scenes/sceneRaffael.unity
guid: bdf7662389bf8487c9a7909d08af8c3e
- enabled: 1
- enabled: 0
path: Assets/Scenes/Valentin.unity
guid: 8c9ceab1c999ea749aa0fe2b0c87b0bf
- enabled: 1
- enabled: 0
path: Assets/Scenes/Niveau2.unity
guid: 4ae30febc4f91474fa9164b85521aaf5
- enabled: 1
......
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