Skip to content
Open

Ui #15

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file modified DreamInvasion/Assets/Resources/Prefabs/Tonneau explosif.prefab
Binary file not shown.
Binary file not shown.
8 changes: 8 additions & 0 deletions DreamInvasion/Assets/Resources/Prefabs/Warrior.prefab.meta

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

Binary file modified DreamInvasion/Assets/Scenes/Steph_Anim.unity
Binary file not shown.
4 changes: 2 additions & 2 deletions DreamInvasion/Assets/Scripts/Attack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void Update () {

this.GetComponent<BoxCollider2D>().enabled = true;

scriptRotation.RotateDown();
//scriptRotation.RotateDown();

this.timeOfLastAttack = Time.time;
attacked = true;
Expand All @@ -53,7 +53,7 @@ void Update () {
this.GetComponent<BoxCollider2D>().enabled = false;
attacked = false;

scriptRotation.RotateUp();
//scriptRotation.RotateUp();
}

}
Expand Down
11 changes: 9 additions & 2 deletions DreamInvasion/Assets/Scripts/Player/Health.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
using UnityEngine;
using System.Collections;
using System;
using UnityEngine.UI;

public class Health : MonoBehaviour {

public float lifeLeft;
float lifeMax;

[SerializeField]
Slider lifeSlider;

Character scriptCharacter;
public static event Action<int> OnDeath;

Expand All @@ -18,12 +22,15 @@ void Start () {
this.lifeMax = scriptCharacter.lifeMax;
lifeLeft = lifeMax;

lifeSlider.value = lifeLeft / lifeMax;

}

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

}

lifeSlider.value = lifeLeft / lifeMax;
}

public void TakeDamage(float damage) {

Expand Down
28 changes: 28 additions & 0 deletions DreamInvasion/Assets/Scripts/Player/LockRot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using UnityEngine;
using System.Collections;

public class LockRot : MonoBehaviour {

bool test = false;

// Use this for initialization
void Start () {

}

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

if(transform.parent.localScale.x < 0 && transform.localScale.x >0 ) {
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}

if (transform.parent.localScale.x > 0 && transform.localScale.x < 0) {
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
}
}
12 changes: 12 additions & 0 deletions DreamInvasion/Assets/Scripts/Player/LockRot.cs.meta

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

9 changes: 9 additions & 0 deletions DreamInvasion/Assets/Sprites/Boss.meta

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

Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,31 @@ private void FixedUpdate()
// The player is grounded if a circlecast to the groundcheck position hits anything designated as ground
// This can be done using layers instead but Sample Assets will not overwrite your project settings.
Collider2D[] colliders = Physics2D.OverlapCircleAll(m_GroundCheck.position, k_GroundedRadius, m_WhatIsGround);
for (int i = 0; i < colliders.Length; i++)
{
for (int i = 0; i < colliders.Length; i++) {
if (colliders[i].gameObject != gameObject)
m_Grounded = true;
}
m_Anim.SetBool("Ground", m_Grounded);

// Set the vertical animation
//Set the vertical animation
m_Anim.SetFloat("vSpeed", m_Rigidbody2D.velocity.y);
}


public void Move(float move, bool crouch, bool jump)
{
// If crouching, check to see if the character can stand up
if (!crouch && m_Anim.GetBool("Crouch"))
{
// If the character has a ceiling preventing them from standing up, keep them crouching
if (Physics2D.OverlapCircle(m_CeilingCheck.position, k_CeilingRadius, m_WhatIsGround))
{
crouch = true;
}
}

// Set whether or not the character is crouching in the animator
m_Anim.SetBool("Crouch", crouch);
//// If crouching, check to see if the character can stand up
//if (!crouch && m_Anim.GetBool("Crouch"))
//{
// // If the character has a ceiling preventing them from standing up, keep them crouching
// if (Physics2D.OverlapCircle(m_CeilingCheck.position, k_CeilingRadius, m_WhatIsGround))
// {
// crouch = true;
// }
//}

//// Set whether or not the character is crouching in the animator
//m_Anim.SetBool("Crouch", crouch);

//only control the player if grounded or airControl is turned on
if (m_Grounded || m_AirControl)
Expand All @@ -71,7 +70,7 @@ public void Move(float move, bool crouch, bool jump)
move = (crouch ? move*m_CrouchSpeed : move);

// The Speed animator parameter is set to the absolute value of the horizontal input.
m_Anim.SetFloat("Speed", Mathf.Abs(move));
//m_Anim.SetFloat("Speed", Mathf.Abs(move));

// Move the character
m_Rigidbody2D.velocity = new Vector2(move*m_MaxSpeed, m_Rigidbody2D.velocity.y);
Expand Down
2 changes: 2 additions & 0 deletions DreamInvasion/DreamInvasion.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@
<Compile Include="Assets\Scripts\Player\Cursor\MoveCursor.cs" />
<Compile Include="Assets\Scripts\Player\Cursor\Stats.cs" />
<Compile Include="Assets\Scripts\Player\Health.cs" />
<Compile Include="Assets\Scripts\Player\LockRot.cs" />
<Compile Include="Assets\Scripts\Player\MyPlatformer2DUserControl.cs" />
<Compile Include="Assets\Scripts\Player\MyPlatformerCharacter2D.cs" />
<Compile Include="Assets\Scripts\RotateOnKeyPressed.cs" />
<Compile Include="Assets\Scripts\RotateSword.cs" />
<Compile Include="Assets\Scripts\Spawnable\Mob.cs" />
Expand Down
56 changes: 18 additions & 38 deletions DreamInvasion/DreamInvasion.sln
Original file line number Diff line number Diff line change
@@ -1,52 +1,32 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2008

Project("{9FB2C7AD-B6CD-5B81-F8E6-9B314D33929E}") = "DreamInvasion", "Assembly-CSharp-firstpass.csproj", "{3615F7D1-2DD0-A55E-4DB6-D9D212FA26C4}"

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2015
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DreamInvasion.CSharp.Plugins", "DreamInvasion.CSharp.Plugins.csproj", "{E0B26F60-398E-DFAD-5C48-A03653CBF50D}"
EndProject
Project("{9FB2C7AD-B6CD-5B81-F8E6-9B314D33929E}") = "DreamInvasion", "Assembly-CSharp.csproj", "{C236A460-C861-FD22-82ED-5F0BDFC4D868}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DreamInvasion.CSharp", "DreamInvasion.CSharp.csproj", "{F59E4867-AA9E-9FD0-7E76-D6D1017B02F0}"
EndProject
Project("{9FB2C7AD-B6CD-5B81-F8E6-9B314D33929E}") = "DreamInvasion", "Assembly-CSharp-Editor.csproj", "{107AE060-1812-8E04-0086-6972047B299C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DreamInvasion.CSharp.Editor", "DreamInvasion.CSharp.Editor.csproj", "{0720C955-728E-25C9-91DE-7EC3EB4BFB9B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3615F7D1-2DD0-A55E-4DB6-D9D212FA26C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3615F7D1-2DD0-A55E-4DB6-D9D212FA26C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3615F7D1-2DD0-A55E-4DB6-D9D212FA26C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3615F7D1-2DD0-A55E-4DB6-D9D212FA26C4}.Release|Any CPU.Build.0 = Release|Any CPU
{C236A460-C861-FD22-82ED-5F0BDFC4D868}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C236A460-C861-FD22-82ED-5F0BDFC4D868}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C236A460-C861-FD22-82ED-5F0BDFC4D868}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C236A460-C861-FD22-82ED-5F0BDFC4D868}.Release|Any CPU.Build.0 = Release|Any CPU
{107AE060-1812-8E04-0086-6972047B299C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{107AE060-1812-8E04-0086-6972047B299C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{107AE060-1812-8E04-0086-6972047B299C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{107AE060-1812-8E04-0086-6972047B299C}.Release|Any CPU.Build.0 = Release|Any CPU
{E0B26F60-398E-DFAD-5C48-A03653CBF50D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0B26F60-398E-DFAD-5C48-A03653CBF50D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0B26F60-398E-DFAD-5C48-A03653CBF50D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0B26F60-398E-DFAD-5C48-A03653CBF50D}.Release|Any CPU.Build.0 = Release|Any CPU
{F59E4867-AA9E-9FD0-7E76-D6D1017B02F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F59E4867-AA9E-9FD0-7E76-D6D1017B02F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F59E4867-AA9E-9FD0-7E76-D6D1017B02F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F59E4867-AA9E-9FD0-7E76-D6D1017B02F0}.Release|Any CPU.Build.0 = Release|Any CPU
{0720C955-728E-25C9-91DE-7EC3EB4BFB9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0720C955-728E-25C9-91DE-7EC3EB4BFB9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0720C955-728E-25C9-91DE-7EC3EB4BFB9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0720C955-728E-25C9-91DE-7EC3EB4BFB9B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Assembly-CSharp.csproj
Policies = $0
$0.TextStylePolicy = $1
$1.inheritsSet = null
$1.scope = text/x-csharp
$0.CSharpFormattingPolicy = $2
$2.inheritsSet = Mono
$2.inheritsScope = text/x-csharp
$2.scope = text/x-csharp
$0.TextStylePolicy = $3
$3.FileWidth = 120
$3.TabWidth = 4
$3.IndentWidth = 4
$3.EolMarker = Unix
$3.inheritsSet = Mono
$3.inheritsScope = text/plain
$3.scope = text/plain
EndGlobalSection

EndGlobal
Binary file modified DreamInvasion/ProjectSettings/ProjectSettings.asset
Binary file not shown.