update
This commit is contained in:
@@ -7,11 +7,13 @@ public class Energia : MonoBehaviour
|
||||
{
|
||||
public TMP_Text[] energiasav_text;
|
||||
private int energiasav_index = 0;
|
||||
public bool granatAktivalva = false;
|
||||
|
||||
public int getEnergiasavIndex() { return energiasav_index; }
|
||||
public void setEnegiasavIndex(int ertek) { energiasav_index = ertek; }
|
||||
|
||||
public void csokkenEnergia(int number) {
|
||||
if (granatAktivalva) return; //targy cucc aktivalva egesz korbe nem csokken az energia
|
||||
if (energiasav_index > 30) return;
|
||||
|
||||
for (int i = 0; i < number; i++) {
|
||||
|
||||
50
Assets/Scripts/Targyak.cs
Normal file
50
Assets/Scripts/Targyak.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Targyak : MonoBehaviour
|
||||
{
|
||||
private Akciok akciok;
|
||||
private Elet elet;
|
||||
private Akciopont akciopont;
|
||||
private movement movement;
|
||||
private Energia energia;
|
||||
|
||||
private void Start() {
|
||||
akciok = FindObjectOfType<Akciok>();
|
||||
elet = FindObjectOfType<Elet>();
|
||||
akciopont = FindObjectOfType<Akciopont>();
|
||||
movement = FindObjectOfType<movement>();
|
||||
energia = FindObjectOfType<Energia>();
|
||||
}
|
||||
|
||||
public void AdrenalinLoket() {
|
||||
|
||||
}
|
||||
|
||||
public void HackerCsatlakozo() { //Hogyan kell aktivalni?
|
||||
//+2 tolteny
|
||||
akciok.Betarazas(2);
|
||||
//+1 elet
|
||||
elet.Eletplusz();
|
||||
//+1 akcio
|
||||
akciopont.akciopont++;
|
||||
}
|
||||
|
||||
public void LathatatlanOltozek() {
|
||||
movement.mozgasHelyre(2, 2); //megadni inkabb a hely nevet ahova menni akar? | input field es nev megadas
|
||||
}
|
||||
|
||||
public void DroidGepagyu() {
|
||||
|
||||
}
|
||||
|
||||
public void MatavTaviranyito() {
|
||||
|
||||
}
|
||||
|
||||
public void FustGranat() {
|
||||
energia.granatAktivalva = true;
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/Scripts/Targyak.cs.meta
Normal file
11
Assets/Scripts/Targyak.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2595afc692aed134ab895e537a2c9f73
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -23,6 +23,7 @@ public class TurnManager : MonoBehaviour
|
||||
dice.setLocked(false);
|
||||
akciopont.resetAkciopont();
|
||||
energia.csokkenEnergia(upgrade.energia[upgrade.getEnergiaIndex()]);
|
||||
energia.granatAktivalva = false; //ha aktivalva lett a granat a korben deaktivalja
|
||||
turnCounter++;
|
||||
dice.hely1.sprite = null;
|
||||
dice.hely2.sprite = null;
|
||||
|
||||
@@ -224,6 +224,58 @@ public class movement : MonoBehaviour {
|
||||
}
|
||||
}
|
||||
|
||||
public void mozgasHelyre(int x, int y) {
|
||||
if(x == 1 && y == 1) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = oneone.transform.position;
|
||||
}else if(x == 1 && y == 2) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = onetwo.transform.position;
|
||||
} else if (x == 1 && y == 3) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = onethree.transform.position;
|
||||
} else if (x == 1 && y == 4) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = onefour.transform.position;
|
||||
}else if (x == 2 && y == 1) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = twoone.transform.position;
|
||||
} else if (x == 2 && y == 2) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = twotwo.transform.position;
|
||||
} else if (x == 2 && y == 3) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = twothree.transform.position;
|
||||
} else if (x == 2 && y == 4) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = twofour.transform.position;
|
||||
}else if (x == 3 && y == 1) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = threeone.transform.position;
|
||||
} else if (x == 3 && y == 2) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = threetwo.transform.position;
|
||||
} else if (x == 3 && y == 3) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = threethree.transform.position;
|
||||
} else if (x == 3 && y == 4) {
|
||||
jelenlegi_x = x;
|
||||
jelenlegi_y = y;
|
||||
player.transform.position = threefour.transform.position;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
public void Update() {
|
||||
tavolsag = math.abs(tavolsag);
|
||||
|
||||
Reference in New Issue
Block a user