style: add spaces after double slashes in comments
This commit is contained in:
parent
d14e41efb5
commit
3a15ce6718
8
Assets/Imported Assets/Fonts.meta
generated
Normal file
8
Assets/Imported Assets/Fonts.meta
generated
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cfe8f7b1cc5c34babb502c5982217fb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
134
Assets/Scenes/SampleScene.unity
generated
134
Assets/Scenes/SampleScene.unity
generated
@ -757,68 +757,6 @@ BoxCollider2D:
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 100, y: 3000}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &351653910
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 351653911}
|
||||
- component: {fileID: 351653912}
|
||||
m_Layer: 0
|
||||
m_Name: Trigger Death (1)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &351653911
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 351653910}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 565597293}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 192}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!61 &351653912
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 351653910}
|
||||
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, y: 0}
|
||||
oldSize: {x: 0, y: 0}
|
||||
newSize: {x: 0, y: 0}
|
||||
adaptiveTilingThreshold: 0
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1000, y: 100}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &374315632
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1226,8 +1164,6 @@ RectTransform:
|
||||
- {fileID: 333766463}
|
||||
- {fileID: 98179538}
|
||||
- {fileID: 2001289698}
|
||||
- {fileID: 351653911}
|
||||
- {fileID: 1566966446}
|
||||
m_Father: {fileID: 221840723}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -1625,7 +1561,7 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1037654662}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -2.5, z: 0}
|
||||
m_LocalPosition: {x: 0, y: -8, z: 0}
|
||||
m_LocalScale: {x: 1.5, y: 1.5, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 710340422}
|
||||
@ -1664,6 +1600,8 @@ MonoBehaviour:
|
||||
_sideForceMultiplier: 1.5
|
||||
_deadZone: 0.9
|
||||
_gravityMultiplier: 1.2
|
||||
_startPosition: {x: 0, y: -2.5}
|
||||
_horisontalRadius: 0.5
|
||||
_touchTrigger: {fileID: 710340420}
|
||||
_scoreManager: {fileID: 229399454}
|
||||
--- !u!114 &1037654669
|
||||
@ -2133,68 +2071,6 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &1566966445
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1566966446}
|
||||
- component: {fileID: 1566966447}
|
||||
m_Layer: 0
|
||||
m_Name: Trigger Death (2)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1566966446
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1566966445}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 565597293}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 1312}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!61 &1566966447
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1566966445}
|
||||
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, y: 0}
|
||||
oldSize: {x: 0, y: 0}
|
||||
newSize: {x: 0, y: 0}
|
||||
adaptiveTilingThreshold: 0
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1000, y: 100}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &1638983504
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2744,7 +2620,7 @@ GameObject:
|
||||
- component: {fileID: 2001289699}
|
||||
m_Layer: 0
|
||||
m_Name: Trigger Death
|
||||
m_TagString: Untagged
|
||||
m_TagString: Floor
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@ -2765,7 +2641,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: -128}
|
||||
m_AnchoredPosition: {x: 0, y: -384}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!61 &2001289699
|
||||
|
@ -11,7 +11,7 @@ public class GameStateController : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
//Change game state to selected in inspector state when the game starts
|
||||
// Change game state to selected in inspector state when the game starts
|
||||
GameStateManager.Instance.ChangeState(ChangeToState);
|
||||
|
||||
PlayerEvents.OnBallTouched += () => GameStateManager.Instance.ChangeState(GameState.Game);
|
||||
@ -19,7 +19,7 @@ public class GameStateController : MonoBehaviour
|
||||
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
//Change game state back to entry state when exiting playing mode
|
||||
// Change game state back to entry state when exiting playing mode
|
||||
GameStateManager.Instance.ChangeState(GameState.Enter);
|
||||
}
|
||||
}
|
||||
@ -35,7 +35,7 @@ class GameStateControllerEditor : Editor
|
||||
var gameStateController = (GameStateController)target;
|
||||
if (gameStateController == null) return;
|
||||
|
||||
//Custom button to change game state from inspector during runtime
|
||||
// Custom button to change game state from inspector during runtime
|
||||
if (GUILayout.Button("Change State"))
|
||||
{
|
||||
if (Application.isPlaying) GameStateManager.Instance.ChangeState(gameStateController.ChangeToState);
|
||||
|
@ -3,7 +3,7 @@ using UnityEngine;
|
||||
|
||||
public class GameStateManager
|
||||
{
|
||||
//Make a singleton to be able to easily access game state manager from any script
|
||||
// Make a singleton to be able to easily access game state manager from any script
|
||||
private static GameStateManager _instance;
|
||||
|
||||
public static GameStateManager Instance
|
||||
@ -17,10 +17,10 @@ public class GameStateManager
|
||||
}
|
||||
}
|
||||
|
||||
//Current game state
|
||||
// Current game state
|
||||
public GameState CurrentGameState { get; private set; }
|
||||
|
||||
//Create an event to be able to easily react on change of game state from any script
|
||||
// Create an event to be able to easily react on change of game state from any script
|
||||
public event Action<GameState> OnGameStateChange;
|
||||
|
||||
public void ChangeState(GameState newGameState)
|
||||
|
@ -30,7 +30,7 @@ public class PlayerController : MonoBehaviour
|
||||
_initialPositionY = _startPosition.y;
|
||||
_initialGravityScale = _rigidbody.gravityScale;
|
||||
|
||||
//Calculate start position (target position of ball spawning animation)
|
||||
// Calculate start position (target position of ball spawning animation)
|
||||
_startPosition = new Vector2(_startPosition.x + Random.Range(-_horisontalRadius, _horisontalRadius), _startPosition.y);
|
||||
transform.position = new Vector2(_startPosition.x, transform.position.y);
|
||||
|
||||
@ -39,21 +39,21 @@ public class PlayerController : MonoBehaviour
|
||||
|
||||
public void OnTouch(Vector2 pointerPos)
|
||||
{
|
||||
//Get bounce direction based on the tap position
|
||||
// Get bounce direction based on the tap position
|
||||
Vector2 bounceDir = (Vector2)transform.position - pointerPos;
|
||||
|
||||
//Check if pointer is placed on the touchable trigger zone
|
||||
// Check if pointer is placed on the touchable trigger zone
|
||||
if (bounceDir.magnitude > 0.5f * _touchTrigger.transform.lossyScale.x) return;
|
||||
|
||||
//Check if the pointer position overlaps the dead zone and set horizontal bounce direction to maximum horizontal bounce direction
|
||||
// Check if the pointer position overlaps the dead zone and set horizontal bounce direction to maximum horizontal bounce direction
|
||||
if (Mathf.Abs(bounceDir.x) >= _deadZone * 0.5f * transform.localScale.x) bounceDir.x = (bounceDir.x > 0 ? _deadZone : -_deadZone) * 0.5f * transform.localScale.x;
|
||||
|
||||
//Reset rigid body's velocity
|
||||
// Reset rigid body's velocity
|
||||
_rigidbody.velocity = Vector2.zero;
|
||||
|
||||
//Apply impulse force
|
||||
// Apply impulse force
|
||||
_rigidbody.AddForce(_punchForce * new Vector2(bounceDir.x * _sideForceMultiplier, _upForceMultiplier), ForceMode2D.Impulse);
|
||||
//Add angular velocity for the visual effect
|
||||
// Add angular velocity for the visual effect
|
||||
_rigidbody.angularVelocity += bounceDir.x * -360f;
|
||||
|
||||
PlayerEvents.SendBallTouched();
|
||||
@ -79,14 +79,14 @@ public class PlayerController : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
//Change gravitational force over height
|
||||
// Change gravitational force over height
|
||||
if (GameStateManager.Instance.CurrentGameState == GameState.Game && transform.position.y > _startPosition.y)
|
||||
_rigidbody.gravityScale = _initialGravityScale + ((transform.position.y - _initialPositionY) * _gravityMultiplier);
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
//Ball spawn animation
|
||||
// Ball spawn animation
|
||||
if (GameStateManager.Instance.CurrentGameState == GameState.Menu)
|
||||
transform.position = Vector3.Lerp(transform.position, _startPosition, 0.15f);
|
||||
}
|
||||
|
@ -8,14 +8,14 @@ public class PlayerInput : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
//Check mouse input
|
||||
// Check mouse input
|
||||
if (Mouse.current != null && Mouse.current.leftButton.wasPressedThisFrame)
|
||||
{
|
||||
_playerController.OnTouch(_camera.ScreenToWorldPoint(Mouse.current.position.ReadValue()));
|
||||
return;
|
||||
}
|
||||
|
||||
//Check touchscreen input
|
||||
// Check touchscreen input
|
||||
if (Touchscreen.current != null && Touchscreen.current.primaryTouch.press.wasPressedThisFrame)
|
||||
{
|
||||
_playerController.OnTouch(_camera.ScreenToWorldPoint(Touchscreen.current.touches[0].position.ReadValue()));
|
||||
|
Loading…
Reference in New Issue
Block a user