Commit 2b026e88 authored by Abdulrahman Mohammed's avatar Abdulrahman Mohammed

Add VFX to coin

parent 2c064b16
......@@ -9,10 +9,13 @@ public class Chip : MonoBehaviour
[SerializeField] AudioClip AudioClip;
[SerializeField] int PosY;
[SerializeField] float Duration;
[SerializeField] ParticleSystem particleSystemEffect;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
particleSystemEffect.transform.position = transform.position;
particleSystemEffect.Play();
ChipManager.instance.AddChip();
Camera.main.GetComponent<AudioSource>().PlayOneShot(AudioClip);
GetComponent<MeshRenderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
......
......@@ -34,7 +34,7 @@ Material:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 348fa4d278c53ad4dacd07df1e63a248, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 62.310833, y: 0}
m_Offset: {x: 10.4946995, y: 0}
- _MainTex2:
m_Texture: {fileID: 2800000, guid: bef54341b6d21864c82d47f3bed4c7db, type: 3}
m_Scale: {x: 1, y: 1}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class HandleRightScreen : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{
InputManager _inputManager;
[SerializeField] float _moveThreshold;
Vector2 _startPos;
private void Start()
{
_inputManager = InputManager.Instance;
}
public void OnBeginDrag(PointerEventData eventData)
{
_startPos = eventData.position;
}
public void OnDrag(PointerEventData eventData)
{
_inputManager.UpdateCameraMovement(eventData.delta);
}
public void OnEndDrag(PointerEventData eventData)
{
_inputManager.UpdateCameraMovement(Vector2.zero);
}
}
fileFormatVersion: 2
guid: 5832d47842759fc4d8e4a4123fc43f44
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -9,12 +9,11 @@ public class ChangeInput : MonoBehaviour
public static ChangeInput Instance;
[SerializeField] Sprite[] icons; // first is pc;
[SerializeField] RectTransform joyStickPanel;
//[SerializeField] RectTransform dialoguePanel;
//[SerializeField] RectTransform dialoguePanelPc;
//[SerializeField] RectTransform dialoguePanelAndroid;
bool SwitchToJoystick;
public float mouseSensitivity { get; private set; }
// for cllision game set .1f for pc and 1f for joystick
InputManager _inputManager;
private void Awake()
{
if (Instance == null)
......@@ -25,6 +24,8 @@ public class ChangeInput : MonoBehaviour
void Start()
{
_inputManager = InputManager.Instance;
GetComponent<Button>().onClick.AddListener(Change);
mouseSensitivity = .1f;
if(PlayerPrefs.GetInt("input",0) == 0)
......@@ -62,6 +63,7 @@ public class ChangeInput : MonoBehaviour
{
//if(dialoguePanel != null)
// dialoguePanel = dialoguePanelPc;
_inputManager.useJoystick = false;
transform.GetChild(0).GetComponent<Image>().sprite = icons[1];
mouseSensitivity = .1f;
}
......@@ -69,8 +71,8 @@ public class ChangeInput : MonoBehaviour
{
//if (dialoguePanel != null)
// dialoguePanel = dialoguePanelAndroid;
_inputManager.useJoystick = true;
transform.GetChild(0).GetComponent<Image>().sprite = icons[0];
mouseSensitivity = 1;
mouseSensitivity = .15f;
}
}
using System;
using UnityEngine;
using UnityEngine.InputSystem.EnhancedTouch;
......@@ -7,8 +8,12 @@ public class InputManager : MonoBehaviour
public Vector2 Move;
public Vector2 Camera;
public bool Boost;
public bool useJoystick;
InputActions _inputActions;
Vector2 _startPos;
Vector2 _delta;
private void Awake()
{
_inputActions = new InputActions();
......@@ -37,26 +42,23 @@ public class InputManager : MonoBehaviour
_inputActions.Player.Boost.performed += ctx => Boost = true;
_inputActions.Player.Boost.canceled += ctx => Boost = false;
}
//void OnApplicationPause(bool pause)
//{
// if (pause)
// {
// Time.timeScale = 0f;
// }
// else
// {
// Time.timeScale = 1f;
// }
//}
//void OnApplicationFocus(bool focus)
//{
// if (!focus)
// {
// Time.timeScale = 0f;
// }
// else
// {
// Time.timeScale = 1f;
// }
//}
private void Update()
{
if (!useJoystick) return;
if (Vector2.Distance(_startPos, _delta) > .01)
{
Camera = _delta;
_startPos = _delta;
}
else
{
Camera = Vector2.zero;
}
}
public void UpdateCameraMovement(Vector2 delta)
{
_delta = delta;
}
}
......@@ -5,40 +5,40 @@ EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
- enabled: 0
path: Assets/Scenes/Car Game/Tutorial Screen.unity
guid: 5fa264385f0cc9544b4dc1bd1e33f578
- enabled: 1
- enabled: 0
path: Assets/Scenes/Car Game/Intro.unity
guid: 4e4353d314055ce4584976af6d6c2808
- enabled: 1
- enabled: 0
path: Assets/Scenes/Car Game/Level 1.unity
guid: fbe9df0776567584caa54591418596ff
- enabled: 1
- enabled: 0
path: Assets/Scenes/Car Game/Level 2.unity
guid: d853ef6f0a6b7434bae3055b5060e35a
- enabled: 1
- enabled: 0
path: Assets/Scenes/Car Game/Level 3.unity
guid: 9724a62ede6115547b82a54372316bb9
- enabled: 1
- enabled: 0
path: Assets/Scenes/Car Game/World.unity
guid: 9fc0d4010bbf28b4594072e72b8655ab
- enabled: 1
- enabled: 0
path: Assets/Scenes/Car Game/End.unity
guid: 46ec004ac47f66a43abbc2c810b62e25
- enabled: 0
- enabled: 1
path: Assets/Scenes/Bio game/Tutorial Screen Intro.unity
guid: edd172c4d65152c409ea566e82c25424
- enabled: 0
- enabled: 1
path: Assets/Scenes/Bio game/BioIntro.unity
guid: f20ab22b1aa93734d81e00b8fd6fad93
- enabled: 0
- enabled: 1
path: Assets/Scenes/Bio game/Tutorial Screen Intro Game.unity
guid: 94bc698ad4d364b4c99264b2f14f3105
- enabled: 0
- enabled: 1
path: Assets/Scenes/Bio game/BioGame.unity
guid: 6aec03f9c3befd54590a9a6538629e98
- enabled: 0
- enabled: 1
path: Assets/Scenes/Bio game/BioEnd.unity
guid: fe2bc7de1cfec244b9dfd662022089ea
m_configObjects:
......
Markdown is supported
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