This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| public class GunSprint : MonoBehaviour { | |
| [SerializeField] private Bullet _bulletPrefab; | |
| [SerializeField] private Transform _spawnPoint; | |
| [SerializeField] private ParticleSystem _smokeSystem; | |
| [SerializeField] private LayerMask _targetLayer; | |
| [SerializeField] private float _bulletSpeed = 12; | |
| [SerializeField] private float _torque = 120; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public static class Vibration | |
| { | |
| #if UNITY_ANDROID && !UNITY_EDITOR | |
| public static AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
| public static AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"); | |
| public static AndroidJavaObject vibrator = currentActivity.Call<AndroidJavaObject>("getSystemService", "vibrator"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class ShakeEffect : MonoBehaviour { | |
| // vars | |
| private bool shakeOn = false; | |
| private float shakePower = 0; | |
| // sprite original position |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| /// http://www.mikedoesweb.com/2012/camera-shake-in-unity/ | |
| public class ObjectShake : MonoBehaviour { | |
| private Vector3 originPosition; | |
| private Quaternion originRotation; | |
| public float shake_decay = 0.002f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| using System; | |
| public class Math3d : MonoBehaviour { | |
| private static Transform tempChild = null; | |
| private static Transform tempParent = null; | |
| public static void Init(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| public class ProceduralBezierCurve : MonoBehaviour { | |
| // visualization variables | |
| public float start = 0f; | |
| public float length = 5f; | |
| public float speed = 0.01f; | |
| private int randomOffset = 0; |