public void Add(Punto p) => Puntos.Add(p);
public void Post(Puntos sync) { db.Puntos.Add(sync); db.SaveChanges(); }
public void BorrarPunto(int index) { Puntos.RemoveAt(index); }
void Awake() { S = this; }
public void borrarPuntos(Puntos punto) { listaPuntos.Remove(punto); }
public void añadirPuntos(float coorX, float coorY) { Puntos pt = new Puntos(coorX, coorY); listaPuntos.Add(pt); }
void Awake() { GameController = this; }
// Update is called once per frame void Update() { if (inmuneCont < inmuneTime) { image.color = Color.blue; } bar.value = LifeManager.getLife() / 300.0f; if (inmuneCont >= inmuneTime && inmune) { image.color = Color.green; inmune = false; } if (rb) { rb.AddForce(Input.GetAxis("Vertical") * force, 0, Input.GetAxis("Horizontal") * force); } //animator.SetFloat("Run", Mathf.Abs(rb.velocity.x)); Ray myRay = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hitInfo; if (Physics.Raycast(myRay, out hitInfo, 20.0f) && Input.GetMouseButtonDown(0)) { animator.SetBool("Shooting", true); shots.Play(); disparo.Play(); if (hitInfo.collider.CompareTag("Zombie")) { hitInfo.collider.gameObject.GetComponent <Zombie>().decreaseLife(); } } //animator.SetBool("Shooting", false); if (Input.GetKeyDown(KeyCode.F) && boxTrigg) { pressF.SetActive(false); int eleccion = Random.Range(0, 2); GameObject boxSup = GameObject.FindGameObjectWithTag("BoxSupplies").GetComponent <Box>().getActualBox(); temp = boxSup.GetComponent <Animator>(); temp.SetBool("Open", true); Box.soncaja(); if (eleccion == 0) { LifeManager.setLife(30); } else { inmune = true; inmuneCont = 0; } power[eleccion].SetActive(true); closed = false; GameObject.FindGameObjectWithTag("BoxSupplies").GetComponent <Box>().looted(); } if (!closed && Input.GetKeyDown(KeyCode.Escape)) { foreach (GameObject child in power) { child.SetActive(false); } temp.SetBool("Open", false); closed = true; } if (LifeManager.getLife() < 0) { Puntos.sonmuere(); Destroy(gameObject); } inmuneCont++; }