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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class LootGravity : MonoBehaviour | |
| { | |
| void Update() | |
| { | |
| var number=0; | |
| Collider[] hitColliders = Physics.OverlapSphere(transform.position, transform.lossyScale.y*0.5f); |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class ShowFPS : MonoBehaviour { | |
| public static float fps; | |
| void OnGUI() | |
| { |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class player2 : MonoBehaviour | |
| { | |
| public int speed = 5; | |
| public float rotationSpeed = 100.0F; | |
| public Rigidbody rb; | |
| public GameObject body; |
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
| IEnumerator Start() | |
| { | |
| while(true)//Бесконечный цикл | |
| { | |
| Collider[] hitColliders = Physics.OverlapSphere(transform.position, 10); //Создаём массив и добавляем туда все объекты в радиусе 10 | |
| for(int i = 0; i<hitColliders.Length; i++) //Проверяем все объекты в массиве | |
| { | |
| if(hitColliders[i].gameObject.tag == "loot")//Если у объекта есть данный тег | |
| { | |
| var rb = hitColliders[i].GetComponent<Rigidbody>();// Создаём переменную rb и пемещаем туда Rigidbody |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.UI; // Добавляем класс с элементами UI | |
| public class body : MonoBehaviour | |
| { | |
| int loot = 0; | |
| public Text text; // Добавляем поле с текстом | |
| void Update() |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| [RequireComponent(typeof(MeshFilter))] //Добавление компонентов | |
| [RequireComponent(typeof(MeshRenderer))] | |
| public class Mesh : MonoBehaviour | |
| { | |
| void Update() | |
| { |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| [RequireComponent(typeof(MeshFilter))] | |
| [RequireComponent(typeof(MeshRenderer))] | |
| public class GenCube : MonoBehaviour | |
| { | |
| public Vector3 translation; | |
| public Vector3 eulerAngles; |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class Search : MonoBehaviour | |
| { | |
| public Collider btarget; | |
| IEnumerator Start() | |
| { | |
| while (true) |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class Gen : MonoBehaviour | |
| { | |
| GameObject player; | |
| public GameObject block; | |
| public Vector3[] points = new Vector3[8]; | |
| void Start() |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class GenMesh : MonoBehaviour | |
| { | |
| public Material material; | |
| void Start() | |
| { | |
| List<Vector3> vertices = new List<Vector3>(); |
OlderNewer