This file contains 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 TerrainDetector | |
{ | |
private TerrainData terrainData; | |
private int alphamapWidth; | |
private int alphamapHeight; | |
private float[,,] splatmapData; | |
private int numTextures; |
This file contains 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 FootSteps : MonoBehaviour | |
{ | |
[SerializeField] | |
private AudioClip[] stoneClips; | |
[SerializeField] | |
private AudioClip[] mudClips; | |
[SerializeField] | |
private AudioClip[] grassClips; |
This file contains 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 UnityEditor; | |
public class ReplaceWithPrefab : EditorWindow | |
{ | |
[SerializeField] private GameObject prefab; | |
[MenuItem("Tools/Replace With Prefab")] | |
static void CreateReplaceWithPrefab() | |
{ |
This file contains 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 BladeTrap : MonoBehaviour | |
{ | |
private void OnCollisionEnter(Collision collision) | |
{ | |
var enemy = collision.collider.GetComponentInParent<Enemy>(); | |
if (enemy == null) | |
return; |
This file contains 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 Gun : MonoBehaviour | |
{ | |
[SerializeField] | |
[Range(0.1f, 1.5f)] | |
private float fireRate = 0.3f; | |
[SerializeField] | |
[Range(1, 10)] |
This file contains 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 UnityEngine.EventSystems; | |
public class UIZoomImage : MonoBehaviour, IScrollHandler | |
{ | |
private Vector3 initialScale; | |
[SerializeField] | |
private float zoomSpeed = 0.1f; | |
[SerializeField] |
This file contains 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Bomb : MonoBehaviour | |
{ | |
[SerializeField] float _countdownTime = 5f; | |
[SerializeField] float _radius = 5f; | |
[SerializeField] int _damage = 5; |
This file contains 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 TMPro; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class AnimatorPanel : MonoBehaviour | |
{ | |
[SerializeField] Animator _animator; | |
[SerializeField] Button _button; | |
void Start() |
This file contains 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 System; | |
using UnityEngine; | |
public class Launcher : MonoBehaviour | |
{ | |
[SerializeField] | |
private Transform[] firePoints; | |
[SerializeField] | |
private Rigidbody projectilePrefab; | |
[SerializeField] |
NewerOlder