Партнерка на США и Канаду по недвижимости, выплаты в крипто
- 30% recurring commission
- Выплаты в USDT
- Вывод каждую неделю
- Комиссия до 5 лет за каждого referral
}
private void OnTriggerEnter2D(Collider2D col){
//При соприкосновении с коллайдером "смерти" (невидимый объект, при столкновении с которым, персонаж зараняется)
if ((col. gameObject. name == "dieCollider") && !inAche) {
health--;
Destroy (col. gameObject);
}
if ((col. gameObject. name == "cutlet")) {
if (health < 3) {
health++;
}
Destroy (col. gameObject);
}
}
}
Класс lvlIndex
using UnityEngine;
using System. Collections;
public class lvlIndex : MonoBehaviour {
public string lvl;
// Use this for initialization
// Update is called once per frame
void Update () {
lvl = Application. loadedLevelName;
DontDestroyOnLoad (gameObject);
}
}
Класс Music
using UnityEngine;
using System. Collections;
public class Music : MonoBehaviour
{
public AudioClip a1, a2, a3, a4, a5;
public AudioSource audio;
// Use this for initialization
void Start () {
int r = (int)Random. Range(0, 4);
switch (r) {
case 0:
audio. PlayOneShot (a1);
break;
case 1:
audio. PlayOneShot (a2);
break;
case 2:
audio. PlayOneShot (a3);
break;
case 3:
audio. PlayOneShot (a4);
break;
case 4:
audio. PlayOneShot (a5);
break;
}
}
Класс newcam
using UnityEngine;
using System. Collections;
public class newcam : MonoBehaviour {
public float dampTime = 0.15f;
private Vector3 velocity = Vector3.zero;
public Transform target;
// Update is called once per frame
void Update ()
{
if (target)
{
Vector3 point = Camera. main. WorldToViewportPoint(new Vector3(target. position. x, target. position. y+0.75f, target. position. z));
Vector3 delta = new Vector3(target. position. x+10, target. position. y+3f, target. position. z) - Camera. main. ViewportToWorldPoint(new Vector3(0.5f, 0.5f, point. z)); //(new Vector3(0.5, 0.5, point. z));
Vector3 destination = transform. position + delta;
transform. position = Vector3.SmoothDamp(transform. position, destination, ref velocity, dampTime);
}
}
}
Класс timer
using UnityEngine;
using System. Collections;
using System;
using System. IO;
public class timer : MonoBehaviour {
public int t;
private int startTime = 0;
//public string level;
void Start()
{
if(Application. loadedLevelName == "SSI")
File. WriteAllText ("E:\\Supersonic Ivan\\score. txt", Convert. ToString(0));
}
// Use this for initialization
void OnEnable()
{
startTime = (int)Time. time;
}
public int globalTimer()
{
t = (int)Time. time - startTime;
return 60 - t;
}
// Update is called once per frame
void Update () {
if (globalTimer () == 0)
Application. LoadLevel ("death");
}
void OnGUI(){
GUI. Box (new Rect (250, 0, 100, 32), "Время " + globalTimer());
}
void OnDestroy() {
int score = Convert. ToInt32(File. ReadAllText ("E:\\Supersonic Ivan\\score. txt"));
score += globalTimer ();
File. WriteAllText ("E:\\Supersonic Ivan\\score. txt", Convert. ToString(score));
}
}
Класс next
using UnityEngine;
using System. Collections;
using System. IO;
using System;
public class next : MonoBehaviour {
int score;
string lvl;
// Use this for initialization
void Start () {
score = Convert. ToInt32(File. ReadAllLines ("E:\\Supersonic Ivan\\score. txt")[0]);
lvl = GameObject. Find ("lvlIndex").GetComponent<lvlIndex> ().lvl;
}
// Update is called once per frame
void Update () {
if (Input. GetKey (KeyCode. Escape)) {
Application. Quit();
}
if (Input. GetKey (KeyCode. E)) {
switch(lvl){
case "SSI":
Application. LoadLevel ("SSI2");
break;
case "SSI2":
Application. LoadLevel ("SSI3");
break;
case "SSI3":
Application. LoadLevel ("SSI4");
break;
case "SSI4":
Application. LoadLevel ("SSI5");
break;
}
}
}
void OnGUI(){
GUI. Box (new Rect (250, 0, 100, 32), "Очки " + score);
}
}
Класс again
using UnityEngine;
using System. Collections;
public class again : timer {
public string lvl;
// Use this for initialization
void Start () {
lvl = GameObject. Find ("lvlIndex").GetComponent<lvlIndex> ().lvl;
}
// Update is called once per frame
void Update () {
lvl = GameObject. Find ("lvlIndex").GetComponent<lvlIndex> ().lvl;
if (Input. GetKey (KeyCode. E)) {
Application. LoadLevel (lvl);
}
}
}
|
Из за большого объема этот материал размещен на нескольких страницах:
1 2 3 4 5 6 |


