Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Points : MonoBehaviour {
- static bool a1killValue = false;
- static bool a2killValue = false;
- static bool a3killValue = false;
- static bool a4killValue = false;
- static bool a5killValue = false;
- static bool a6killValue = false;
- static bool a7killValue = false;
- // public int mOrreuN;
- // Start is called before the first frame update
- protected void SetukillValue() {
- a1killValue = true;
- }
- protected void SetzkillValue() {
- a2killValue = true;
- }
- protected void Setz2killValue() {
- a3killValue = true;
- }
- protected void SetikillValue() {
- a4killValue = true;
- }
- protected void SetpkillValue() {
- a5killValue = true;
- }
- protected void SetakillValue() {
- a6killValue = true;
- }
- protected void SetpkyllValue() {
- a7killValue = true;
- }
- // Update is called once per frame
- private void Update() {
- if(a1killValue & a2killValue & a3killValue & a4killValue & a5killValue & a6killValue & a7killValue) {
- Application.Quit();
- //print("Fim de Jogo");
- }
- }
- }
- //Filho
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class KillU : Points {
- private float pLaceX;
- private float pLaceY;
- private float pLace2Y;
- private void OnTriggerEnter2D(Collider2D collision) {
- // toDie++;
- SetukillValue();
- //Cheking();
- bool myBool = (Random.value > 0.5f);
- if(collision.transform.CompareTag("Player"))
- pLaceX = Random.Range(-10, 9.3f);
- pLaceY = Random.Range(-5.33f, -1);
- pLace2Y = Random.Range(5.37f, 2.5f);
- gameObject.GetComponent<CircleCollider2D>().enabled = false;
- if(myBool) {
- collision.transform.position = new Vector2(pLaceX, pLace2Y);
- // myBool = false;
- } else {
- collision.transform.position = new Vector2(pLaceX, pLaceY);
- // myBool = true;
- }
- //collision.transform.position = spawnpoint.position;
- //Ger and Set MorreuN Value
- //toDie = GetMorreu();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement