Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
FootBall
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Tài Tuệ
FootBall
Commits
7a3797d3
Commit
7a3797d3
authored
May 10, 2024
by
taitue2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0ca315ba
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
12393 additions
and
59336 deletions
+12393
-59336
Shootout.unity.meta
Assets/Scenes/Modes/Shootout.unity.meta
+0
-9
Targets 1.unity
Assets/Scenes/Modes/Targets 1.unity
+12086
-12775
Targets 1.unity.meta
Assets/Scenes/Modes/Targets 1.unity.meta
+1
-1
Targets.unity
Assets/Scenes/Modes/Targets.unity
+187
-239
Time Attack.unity
Assets/Scenes/Modes/Time Attack.unity
+0
-17635
Time Attack.unity.meta
Assets/Scenes/Modes/Time Attack.unity.meta
+0
-9
Tutorial.unity
Assets/Scenes/Modes/Tutorial.unity
+0
-10388
Wall.unity
Assets/Scenes/Modes/Wall.unity
+0
-18260
Wall.unity.meta
Assets/Scenes/Modes/Wall.unity.meta
+0
-9
BallCheckOut.cs
Assets/_Scripts/BallCheckOut.cs
+6
-1
BallController.cs
Assets/_Scripts/BallController.cs
+17
-7
GKController.cs
Assets/_Scripts/GKController.cs
+18
-0
GKController.cs.meta
Assets/_Scripts/GKController.cs.meta
+11
-0
GameManager.cs
Assets/_Scripts/GameManager.cs
+11
-3
ShakeCamera.cs
Assets/_Scripts/ShakeCamera.cs
+34
-0
ShakeCamera.cs.meta
Assets/_Scripts/ShakeCamera.cs.meta
+11
-0
VarCheckGoal.cs
Assets/_Scripts/VarCheckGoal.cs
+1
-0
manifest.json
Packages/manifest.json
+1
-0
packages-lock.json
Packages/packages-lock.json
+9
-0
No files found.
Assets/Scenes/Modes/Shootout.unity.meta
deleted
100644 → 0
View file @
0ca315ba
fileFormatVersion: 2
guid: 9d8ff8cc2c7c6ee41a32611637b53b45
timeCreated: 1715247515
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scenes/Modes/
Shootout
.unity
→
Assets/Scenes/Modes/
Targets 1
.unity
View file @
7a3797d3
This diff is collapsed.
Click to expand it.
Assets/Scenes/Modes/T
utorial
.unity.meta
→
Assets/Scenes/Modes/T
argets 1
.unity.meta
View file @
7a3797d3
fileFormatVersion: 2
fileFormatVersion: 2
guid:
476097be91b616449863e30fb3f6c12a
guid:
ff9b4a4d52f3bd44d93d618bc931b99b
timeCreated: 1715247515
timeCreated: 1715247515
licenseType: Free
licenseType: Free
DefaultImporter:
DefaultImporter:
...
...
Assets/Scenes/Modes/Targets.unity
View file @
7a3797d3
This diff is collapsed.
Click to expand it.
Assets/Scenes/Modes/Time Attack.unity
deleted
100644 → 0
View file @
0ca315ba
This diff is collapsed.
Click to expand it.
Assets/Scenes/Modes/Time Attack.unity.meta
deleted
100644 → 0
View file @
0ca315ba
fileFormatVersion: 2
guid: c6546786ce4fe134db3b35d17ba43cda
timeCreated: 1715247515
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scenes/Modes/Tutorial.unity
deleted
100644 → 0
View file @
0ca315ba
This diff is collapsed.
Click to expand it.
Assets/Scenes/Modes/Wall.unity
deleted
100644 → 0
View file @
0ca315ba
This diff is collapsed.
Click to expand it.
Assets/Scenes/Modes/Wall.unity.meta
deleted
100644 → 0
View file @
0ca315ba
fileFormatVersion: 2
guid: 5ebc3e0dc1d87f14f8821f62880619ee
timeCreated: 1715247515
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/_Scripts/BallCheckOut.cs
View file @
7a3797d3
...
@@ -4,13 +4,18 @@ using UnityEngine;
...
@@ -4,13 +4,18 @@ using UnityEngine;
public
class
BallCheckOut
:
MonoBehaviour
public
class
BallCheckOut
:
MonoBehaviour
{
{
[
SerializeField
]
int
type
=
0
;
private
void
OnCollisionEnter
(
Collision
collision
)
private
void
OnCollisionEnter
(
Collision
collision
)
{
{
if
(
collision
.
gameObject
.
CompareTag
(
"Ball"
))
if
(
collision
.
gameObject
.
CompareTag
(
"Ball"
))
{
{
if
(
GetComponent
<
AudioSource
>()
!=
null
)
if
(
GetComponent
<
AudioSource
>()
!=
null
)
GetComponent
<
AudioSource
>().
Play
();
GetComponent
<
AudioSource
>().
Play
();
if
(
type
==
1
)
{
GameManager
.
intance
.
MainCamera
.
GetComponent
<
ShakeCamera
>().
PlayCameraShake
(
0.4f
);
}
}
}
}
}
}
}
Assets/_Scripts/BallController.cs
View file @
7a3797d3
...
@@ -19,6 +19,7 @@ public class BallController : MonoBehaviour
...
@@ -19,6 +19,7 @@ public class BallController : MonoBehaviour
[
SerializeField
]
AudioClip
Catch
;
[
SerializeField
]
AudioClip
Catch
;
[
SerializeField
]
AudioClip
Kick
;
[
SerializeField
]
AudioClip
Kick
;
[
SerializeField
]
TrailRenderer
train
;
Rigidbody
rb
;
Rigidbody
rb
;
void
Start
()
void
Start
()
...
@@ -32,9 +33,7 @@ public class BallController : MonoBehaviour
...
@@ -32,9 +33,7 @@ public class BallController : MonoBehaviour
void
Update
()
void
Update
()
{
{
if
(!
isCanShot
)
return
;
if
(!
isCanShot
)
return
;
//if (isSelected)
//{
//PlayerDataReceiver.intance.SendItemData(gameObject.name, gameObject.transform.position.ToString(), gameObject.transform.rotation.ToString(), gameObject.transform.localScale.ToString());
if
(
Input
.
GetMouseButtonDown
(
0
))
if
(
Input
.
GetMouseButtonDown
(
0
))
{
{
// Ghi lại thời gian khi chuột được nhấn và vị trí ban đầu
// Ghi lại thời gian khi chuột được nhấn và vị trí ban đầu
...
@@ -53,6 +52,9 @@ public class BallController : MonoBehaviour
...
@@ -53,6 +52,9 @@ public class BallController : MonoBehaviour
// Lấy vị trí chuột khi được thả ra
// Lấy vị trí chuột khi được thả ra
endPos
=
Input
.
mousePosition
;
endPos
=
Input
.
mousePosition
;
//endPos = Camera.main.ScreenToWorldPoint(new Vector3(endPos.x, endPos.y, Camera.main.transform.position.y));
//startPos = Camera.main.ScreenToWorldPoint(new Vector3(startPos.x, startPos.y, Camera.main.transform.position.y));
//endPos.
//endPos.
//float a = Mathf.Clamp(endPos.y, 0, 600f);
//float a = Mathf.Clamp(endPos.y, 0, 600f);
//endPos = new Vector3(endPos.x, a, endPos.y);
//endPos = new Vector3(endPos.x, a, endPos.y);
...
@@ -64,8 +66,10 @@ public class BallController : MonoBehaviour
...
@@ -64,8 +66,10 @@ public class BallController : MonoBehaviour
//direction = new Vector2(a, b);
//direction = new Vector2(a, b);
// Thêm lực cho rigidbody của đối tượng 3D dựa trên hướng và lực ném
// Thêm lực cho rigidbody của đối tượng 3D dựa trên hướng và lực ném
rb
.
isKinematic
=
false
;
//
rb.isKinematic = false;
rb
.
AddForce
(-
direction
.
x
*
throwForceInXandY
,
-
direction
.
y
*
throwForceInXandY
,
throwForceInZ
/
timeInterval
);
rb
.
AddForce
(-
direction
.
x
*
throwForceInXandY
,
-
direction
.
y
*
throwForceInXandY
,
throwForceInZ
/
timeInterval
);
isCanShot
=
false
;
isCanShot
=
false
;
ballAudio
.
PlayOneShot
(
Kick
);
ballAudio
.
PlayOneShot
(
Kick
);
// Hủy đối tượng sau 3 giây
// Hủy đối tượng sau 3 giây
...
@@ -106,19 +110,25 @@ public class BallController : MonoBehaviour
...
@@ -106,19 +110,25 @@ public class BallController : MonoBehaviour
transform
.
position
=
Vector3
.
zero
;
transform
.
position
=
Vector3
.
zero
;
gameObject
.
SetActive
(
false
);
gameObject
.
SetActive
(
false
);
//transform.position.vecto
//transform.position.vecto
rb
.
velocity
=
Vector3
.
zero
;
rb
.
angularVelocity
=
Vector3
.
zero
;
train
.
enabled
=
false
;
//Debug.Log(transform.position);
//Debug.Log(transform.position);
GameManager
.
intance
.
SetUpGame
();
GameManager
.
intance
.
SetUpGame
();
isCanShot
=
true
;
isCanShot
=
true
;
}
}
public
void
OpenTrain
()
{
train
.
enabled
=
true
;
}
private
void
OnCollisionEnter
(
Collision
collision
)
private
void
OnCollisionEnter
(
Collision
collision
)
{
{
if
(
collision
.
gameObject
.
CompareTag
(
"Player"
))
if
(
collision
.
gameObject
.
CompareTag
(
"Player"
))
{
{
//ballAudio.clip = Catch;
ballAudio
.
PlayOneShot
(
Catch
);
ballAudio
.
PlayOneShot
(
Catch
);
}
}
...
...
Assets/_Scripts/GKController.cs
0 → 100644
View file @
7a3797d3
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
GKController
:
MonoBehaviour
{
void
Start
()
{
}
void
Update
()
{
}
}
Assets/_Scripts/GKController.cs.meta
0 → 100644
View file @
7a3797d3
fileFormatVersion: 2
guid: b437b8220d533674ebd24538ba19b703
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/_Scripts/GameManager.cs
View file @
7a3797d3
...
@@ -23,14 +23,22 @@ public class GameManager : MonoBehaviour
...
@@ -23,14 +23,22 @@ public class GameManager : MonoBehaviour
offset
=
MainCamera
.
transform
.
position
-
BallPrefabs
.
transform
.
position
;
offset
=
MainCamera
.
transform
.
position
-
BallPrefabs
.
transform
.
position
;
}
}
public
void
SetUpGame
()
public
void
SetUpGame
()
{
{
MainCamera
.
transform
.
position
=
new
Vector3
(
Random
.
Range
(-
14f
,
14f
),
1.3f
,
Random
.
Range
(
55
,
70
));
//MainCamera.transform.position = new Vector3 ( Random.Range(-14f,14f),1.3f,Random.Range(55, 65));
MainCamera
.
transform
.
position
=
new
Vector3
(
0
,
1.3f
,
61.5f
);
MainCamera
.
transform
.
LookAt
(
LookAtTarget
.
transform
);
MainCamera
.
transform
.
LookAt
(
LookAtTarget
.
transform
);
goalkeeperAnimator
.
gameObject
.
transform
.
LookAt
(
BallPrefabs
.
transform
);
goalkeeperAnimator
.
Play
(
"Idle"
);
goalkeeperAnimator
.
Play
(
"Idle"
);
//goalkeeperAnimator.gameObject.transform.LookAt(BallPrefabs.transform);
Vector3
ballPosition
=
MainCamera
.
transform
.
position
-
MainCamera
.
transform
.
forward
*
offset
.
z
+
MainCamera
.
transform
.
up
*
offset
.
y
;
Vector3
ballPosition
=
MainCamera
.
transform
.
position
-
MainCamera
.
transform
.
forward
*
offset
.
z
+
MainCamera
.
transform
.
up
*
offset
.
y
;
ballPosition
=
new
Vector3
(
ballPosition
.
x
,
0.2f
,
ballPosition
.
z
);
//Instantiate(BallPrefabs, MainCamera.transform.position - offset, Quaternion.identity);
//Instantiate(BallPrefabs, MainCamera.transform.position - offset, Quaternion.identity);
Instantiate
(
BallPrefabs
,
ballPosition
,
Quaternion
.
identity
);
//
Instantiate(BallPrefabs, ballPosition, Quaternion.identity);
//Instantiate(BallPrefabs, new Vector3 (MainCamera.transform.position.x - offset.x , 0.2f, MainCamera.transform.position.z - offset.z), Quaternion.identity);
//Instantiate(BallPrefabs, new Vector3 (MainCamera.transform.position.x - offset.x , 0.2f, MainCamera.transform.position.z - offset.z), Quaternion.identity);
//new Vector3(0, 0.2f, 68.38f);
//new Vector3(0, 0.2f, 68.38f);
BallPrefabs
.
transform
.
position
=
ballPosition
;
BallPrefabs
.
SetActive
(
true
);
BallPrefabs
.
GetComponent
<
BallController
>().
OpenTrain
();
}
}
}
}
Assets/_Scripts/ShakeCamera.cs
0 → 100644
View file @
7a3797d3
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
ShakeCamera
:
MonoBehaviour
{
float
shakeDuration
=
1f
;
float
shakeMagnitude
=
0.2f
;
Vector3
initialPosition
;
void
Start
()
{
initialPosition
=
transform
.
position
;
}
public
void
PlayCameraShake
(
float
shakeTime
)
{
shakeDuration
=
shakeTime
;
StartCoroutine
(
ShakeCameraAction
());
}
IEnumerator
ShakeCameraAction
()
{
float
elapsedTime
=
0
;
while
(
elapsedTime
<
shakeDuration
)
{
transform
.
position
=
initialPosition
+
(
Vector3
)
Random
.
insideUnitCircle
*
shakeMagnitude
;
elapsedTime
+=
Time
.
deltaTime
;
yield
return
new
WaitForEndOfFrame
();
}
transform
.
position
=
initialPosition
;
}
}
Assets/_Scripts/ShakeCamera.cs.meta
0 → 100644
View file @
7a3797d3
fileFormatVersion: 2
guid: c9717514b15d95045b3547ec1c20f2aa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/_Scripts/VarCheckGoal.cs
View file @
7a3797d3
...
@@ -12,6 +12,7 @@ public class VarCheckGoal : MonoBehaviour
...
@@ -12,6 +12,7 @@ public class VarCheckGoal : MonoBehaviour
Score
++;
Score
++;
GetComponent
<
AudioSource
>().
Play
();
GetComponent
<
AudioSource
>().
Play
();
BackGroundView
.
intance
.
ShowCheckImage
(
true
);
BackGroundView
.
intance
.
ShowCheckImage
(
true
);
GameManager
.
intance
.
MainCamera
.
GetComponent
<
ShakeCamera
>().
PlayCameraShake
(
1f
);
}
}
}
}
}
}
Packages/manifest.json
View file @
7a3797d3
{
{
"dependencies"
:
{
"dependencies"
:
{
"com.unity.cinemachine"
:
"2.9.7"
,
"com.unity.collab-proxy"
:
"2.3.1"
,
"com.unity.collab-proxy"
:
"2.3.1"
,
"com.unity.feature.development"
:
"1.0.1"
,
"com.unity.feature.development"
:
"1.0.1"
,
"com.unity.textmeshpro"
:
"3.0.8"
,
"com.unity.textmeshpro"
:
"3.0.8"
,
...
...
Packages/packages-lock.json
View file @
7a3797d3
{
{
"dependencies"
:
{
"dependencies"
:
{
"com.unity.cinemachine"
:
{
"version"
:
"2.9.7"
,
"depth"
:
0
,
"source"
:
"registry"
,
"dependencies"
:
{
"com.unity.test-framework"
:
"1.1.31"
},
"url"
:
"https://packages.unity.com"
},
"com.unity.collab-proxy"
:
{
"com.unity.collab-proxy"
:
{
"version"
:
"2.3.1"
,
"version"
:
"2.3.1"
,
"depth"
:
0
,
"depth"
:
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment