Партнерка на США и Канаду по недвижимости, выплаты в крипто
- 30% recurring commission
- Выплаты в USDT
- Вывод каждую неделю
- Комиссия до 5 лет за каждого referral
move = 0f;
else if(!isThrow && isGrounded) move = 1f;
}
//Реализация триггеров
void OnTriggerEnter2D(Collider2D col){
//При соприкосновении с коллайдером "смерти" (невидимый объект, при столкновении с которым, персонаж зараняется)
if ((col. gameObject. name == "dieCollider"))
{
if (!inAche) {
if (!isSlide) {
inAche = true;
if (!anim. GetBool ("jump") && !anim. GetBool ("fall") && !anim. GetBool ("ache")) {
rigid2d. velocity = new Vector2 (0, 0);
rigid2d. AddForce (new Vector2 (0, 700f));
} else if (!isSlide) {
rigid2d. velocity = new Vector2 (0, 0);
rigid2d. AddForce (new Vector2 (0, 700f));
}
}
}
}
if (col. gameObject. name == "endLevel") {
Application. LoadLevel ("win");
}
if (col. gameObject. name == "throwCollider") {
inAche = true;
isThrow = true;
rigid2d. velocity = new Vector2 (0, 0);
rigid2d. AddForce (new Vector2 (0, 500f));
move = -1f;
}
if (col. gameObject. name == "clock") {
clockBonus = true;
Destroy (col. gameObject);
}
if (col. gameObject. name == "balloon") {
anim. SetBool ("boom", true);
}
}
}
Класс balloon
using UnityEngine;
using System. Collections;
public class balloon : MonoBehaviour {
public Animator anim;
public float r;
// Use this for initialization
void Start ()
{
anim = GetComponent<Animator> ();
r = (float)Random. Range(-3f, 3f);
}
// Update is called once per frame
void Update ()
{
transform. Translate(r/30, 0, r*Time. deltaTime);
}
void OnTriggerEnter2D(Collider2D col){
if (col. gameObject. name == "Ivan") {
anim. SetBool ("boom", true);
}
}
}
Класс door
using UnityEngine;
using System. Collections;
public class door : MonoBehaviour {
public int kick = 0;
// Use this for initialization
void Start () {
kick = 0;
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D(Collider2D col){
if (col. gameObject. name == "Ivan") {
kick = 1;
}
}
}
Класс doorKick
using UnityEngine;
using System. Collections;
public class doorKick : door
{
public Transform target;
public Transform target2;
// Update is called once per frame
void Update ()
{
if (kick == 1)
{
GetComponent<Rigidbody2D> ().AddForce (new Vector2 (800, 800));
GetComponent<BoxCollider2D> ().enabled = false;
kick = 2;
}
if(kick == 2) GetComponent<Rigidbody2D> ().MoveRotation (20);
}
}
Класс healthBar
using UnityEngine;
using System. Collections;
public class healthBar : MonoBehaviour {
public int health;
public Texture2D cutlet;
public Texture2D clock;
bool inAche = false;
bool clockBonus = false;
public float timer;
// Use this for initialization
void Start () {
health = 2;
timer = 0.4f;
}
// Update is called once per frame
void Update () {
inAche = GameObject. Find ("Ivan").GetComponent<characterController> ().inAche;
clockBonus = GameObject. Find ("Ivan").GetComponent<characterController> ().clockBonus;
if (health == 0) {
Time. timeScale = 0.1f;
if (timer > 0)
timer -= Time. deltaTime;
else
Application. LoadLevel ("death");
}
}
private void OnGUI(){
// Create one Group to contain both images
// Adjust the first 2 coordinates to place it somewhere else on-screen
GUI. BeginGroup (new Rect (0,0,200,32));
GUI. Box (new Rect (0,0,64,32), cutlet);
GUI. Box (new Rect (64,0,64,32), "x" + health);
GUI. EndGroup ();
GUI. BeginGroup (new Rect (0,32,64,32));
if(clockBonus)
GUI. Box (new Rect (0,0,64,32), clock);
else GUI. Box (new Rect (0,0,64,32), "");
GUI. EndGroup ();
|
Из за большого объема этот материал размещен на нескольких страницах:
1 2 3 4 5 6 |


