script updates

This commit is contained in:
2022-11-22 14:45:32 +01:00
parent 5fd194ab6d
commit 979509fd9d
5 changed files with 641 additions and 347 deletions

View File

@@ -11,6 +11,12 @@ public class Targyak : MonoBehaviour
private Energia energia;
public int targy_szamlalo = 0;
public int adrenalinloket = 0;
public int hackercsatlakozo = 0;
public int lathatatlanoltozet = 0;
public int droidgepagyu = 0;
public int matavtaviranyito = 0;
public int fustgranat = 0;
private void Start() {
akciok = FindObjectOfType<Akciok>();
@@ -20,7 +26,43 @@ public class Targyak : MonoBehaviour
energia = FindObjectOfType<Energia>();
}
public void RandomTargy()
{
int randomszam = UnityEngine.Random.Range(0, 5);
if (randomszam == 0)
{
adrenalinloket++;
Debug.Log("Kaptál egy AdrenalinLöketet!");
}
else if (randomszam == 1)
{
hackercsatlakozo++;
Debug.Log("Kaptál egy Hacker Csatlakozót!");
}
else if (randomszam == 2)
{
lathatatlanoltozet++;
Debug.Log("Kaptál egy Láthatatlan Öltözetet!");
}
else if (randomszam == 3)
{
droidgepagyu++;
Debug.Log("Kaptál egy Droid-X2 Gépágyút!");
}
else if (randomszam == 4)
{
matavtaviranyito++;
Debug.Log("Kaptál egy Mata'v Távirányítót!");
}
else if (randomszam == 5)
{
fustgranat++;
Debug.Log("Kaptál egy Álomhozó Füstgránátot!");
}
}
public void AdrenalinLoket() {
targy_szamlalo++;
}
public void HackerCsatlakozo() { //Hogyan kell aktivalni?
@@ -30,22 +72,25 @@ public class Targyak : MonoBehaviour
elet.Eletplusz();
//+1 akcio
akciopont.akciopont++;
targy_szamlalo++;
}
public void LathatatlanOltozek() {
movement.mozgasHelyre(2, 2); //megadni inkabb a hely nevet ahova menni akar? | input field es nev megadas
targy_szamlalo++;
}
public void DroidGepagyu() {
targy_szamlalo++;
}
public void MatavTaviranyito() {
targy_szamlalo++;
}
public void FustGranat() {
energia.granatAktivalva = true;
energia.granatAktivalva = true;
targy_szamlalo++;
}
}

View File

@@ -1,12 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using System;
using UnityEngine;
public class Upgrade : MonoBehaviour
{
private Akciopont akciopont;
public readonly int[] energia = { 3, 3, 2, 2, 1 };
public readonly int[] akcio = { 0, 0, 1, 1, 2 };
public readonly int[] harc = { 1, 1, 2, 2, 3 };
@@ -30,6 +27,10 @@ public class Upgrade : MonoBehaviour
public int getUjradobasIndex() { return ujradobas_index; }
public int getHackIndex() { return hack_index; }
private void Start()
{
akciopont = FindObjectOfType<Akciopont>();
}
public void upgradeEnergia() {
if (canUpgrade) {
if (energia_index < 4) {
@@ -39,6 +40,7 @@ public class Upgrade : MonoBehaviour
Debug.Log("energia_i: " + energia_index);
canUpgrade = false;
fejlesztes_szamlalo++;
akciopont.akciopont--;
}
}
@@ -51,6 +53,7 @@ public class Upgrade : MonoBehaviour
Debug.Log("akcio_i: " + akcio_index);
canUpgrade = false;
fejlesztes_szamlalo++;
akciopont.akciopont--;
}
}
@@ -63,6 +66,7 @@ public class Upgrade : MonoBehaviour
Debug.Log("harc_i: " + harc_index);
canUpgrade = false;
fejlesztes_szamlalo++;
akciopont.akciopont--;
}
}
@@ -75,6 +79,7 @@ public class Upgrade : MonoBehaviour
Debug.Log("ujradobas_i: " + ujradobas_index);
canUpgrade = false;
fejlesztes_szamlalo++;
akciopont.akciopont--;
}
}
@@ -87,6 +92,7 @@ public class Upgrade : MonoBehaviour
Debug.Log("hack_i: " + hack_index);
canUpgrade = false;
fejlesztes_szamlalo++;
akciopont.akciopont--;
}
}
}

View File

@@ -1,16 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEditor;
using UnityEngine;
public class helyszinaktivalas : MonoBehaviour
{
private Elet elet;
private Akciok akciok;
private Targyak targyak;
private Dice dice;
public Upgrade upgrade;
private Upgrade upgrade;
private Akciopont akciopont;
public movement movement;
private movement movement;
//int movement.jelenlegi_x;
//int movement.movement.jelenlegi_y;
bool canUpgrade = false;
private int diceResult;
public Sprite[] diceSides = new Sprite[6];
public SpriteRenderer hely1;
// Start is called before the first frame update
void Start()
@@ -19,6 +27,9 @@ public class helyszinaktivalas : MonoBehaviour
akciopont = FindObjectOfType<Akciopont>();
movement = FindObjectOfType<movement>();
upgrade = FindObjectOfType<Upgrade>();
targyak = FindObjectOfType<Targyak>();
akciok = FindObjectOfType<Akciok>();
elet = FindObjectOfType<Elet>();
}
// Update is called once per frame
@@ -36,16 +47,16 @@ public class helyszinaktivalas : MonoBehaviour
{
//ügynökcsapat ölés bárhol töltény nélkül
}
//2-es mezõ
//2-es mezõ -- KÉSZ
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 1)
{
canUpgrade = true;
//1 fejlesztés ingyen
akciopont.akciopont++;
}
//3-es mezõ
//3-es mezõ -- KÉSZ
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 1)
{
//behuzni a boxcollidereket es kattintásra átváltani a játékos helyét
movement.helyreTeleport();
}
//4-es mezõ
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 2)
@@ -55,55 +66,71 @@ public class helyszinaktivalas : MonoBehaviour
//5-es mezõ
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 2)
{
dice.setLocked(false);
/*if (dobas % 2 == 0)
{
akciopont = akciopont + 3
}
else
{
energia - 1
}
*/
/*diceResult = RollDice();
hely1.sprite = diceSides[diceResult - 1];
hely1.size = new Vector2(38, 38);
targyak.targy_szamlalo++;*/
}
//6-es mezõ
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 2)
{
//+1 akció
}
//7-es mezõ
//7-es mezõ -- KÉSZ
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 3)
{
canUpgrade = true;
//1 fejlesztés ingyen
canUpgrade = true;
akciopont.akciopont++;
}
//8-es mezõ
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 3)
{
dice.setLocked(false);
/*dob két kockával
az egyik +X akció
a másik -X energia*/
/*diceResult = RollDice();
hely1.sprite = diceSides[diceResult - 1];
hely1.size = new Vector2(38, 38);
targyak.targy_szamlalo++;*/
}
//9-es mezõ
//9-es mezõ -- KÉSZ
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 3)
{
//kapsz egy tárgyat
targyak.RandomTargy();
targyak.targy_szamlalo++;
}
//10-es mezõ
//10-es mezõ -- KÉSZ ?
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 4)
{
//+4 töltény
akciok.Betarazas(4);
}
//11-es mezõ
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 4)
{
//Dobj! Megkapod a tárgyat.
/* diceResult = RollDice();
hely1.sprite = diceSides[diceResult - 1];
hely1.size = new Vector2(38, 38);
targyak.targy_szamlalo++;*/
}
//12-es mezõ
//12-es mezõ -- KÉSZ
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 4)
{
//+1 élet
elet.Eletplusz();
}
}
/*private int RollDice()
{
int randomDiceSide = UnityEngine.Random.Range(0, 5);
int finalSide = randomDiceSide + 1;
Debug.Log(finalSide);
return finalSide;
}*/
}

File diff suppressed because it is too large Load Diff

View File

@@ -16,8 +16,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 43
width: 1366
height: 685
width: 1920
height: 997
m_ShowMode: 4
m_Title: Hierarchy
m_RootView: {fileID: 4}
@@ -39,12 +39,12 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 549
x: 772
y: 0
width: 491
height: 256
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
width: 690
height: 382
m_MinSize: {x: 102, y: 121}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 14}
m_Panes:
- {fileID: 14}
@@ -68,13 +68,13 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 379
width: 1040
height: 256
y: 565
width: 1462
height: 382
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 8676
controlID: 101
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -95,8 +95,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1366
height: 685
width: 1920
height: 997
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
m_UseTopView: 1
@@ -120,7 +120,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1366
width: 1920
height: 30
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
@@ -141,8 +141,8 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 665
width: 1366
y: 977
width: 1920
height: 20
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
@@ -165,12 +165,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 30
width: 1366
height: 635
width: 1920
height: 947
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 8420
controlID: 32
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -190,12 +190,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1040
height: 635
width: 1462
height: 947
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 8421
controlID: 20
--- !u!114 &9
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -215,12 +215,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1040
height: 379
width: 1462
height: 565
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 8422
controlID: 21
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -238,8 +238,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 231
height: 379
width: 325
height: 565
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 16}
@@ -262,10 +262,10 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 231
x: 325
y: 0
width: 809
height: 379
width: 1137
height: 565
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 17}
@@ -291,8 +291,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 549
height: 256
width: 772
height: 382
m_MinSize: {x: 231, y: 271}
m_MaxSize: {x: 10001, y: 10021}
m_ActualView: {fileID: 18}
@@ -315,12 +315,12 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 1040
x: 1462
y: 0
width: 326
height: 635
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
width: 458
height: 947
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 19}
m_Panes:
- {fileID: 19}
@@ -346,10 +346,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 549
y: 452
width: 489
height: 235
x: 772
y: 638
width: 688
height: 361
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -468,8 +468,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 73
width: 230
height: 358
width: 324
height: 544
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -479,7 +479,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 48a4ffffeaa4ffffdcafffff7eb0ffff40b4ffff4ab4ffff88bbffff92bbffffcebeffffd8beffff48daffffaedcffff2cdeffff98e1ffffb4e7ffff58e8ffff2aeaffff34eaffff10ecffffb2ecffff78f0ffff86f0ffff1efbffff84c40000a2c50000c2c500003ae000005ae00000482c0100802c0100464201007242010040430100f243010008460100c8460100364801008e48010002490100ce490100b64a01004e4b0100be4b0100c84b0100
m_ExpandedIDs: 16fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -523,10 +523,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 231
x: 325
y: 73
width: 807
height: 358
width: 1135
height: 544
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -783,7 +783,7 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: -4.5111804, y: -0.88972795, z: 0.084217325}
m_Target: {x: -3.364283, y: 2.026196, z: -0.4083693}
speed: 2
m_Value: {x: -4.5111804, y: -0.88972795, z: 0.084217325}
m_RenderMode: 0
@@ -836,7 +836,7 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 13.015009
m_Target: 7.183238
speed: 2
m_Value: 13.015009
m_Ortho:
@@ -884,9 +884,9 @@ MonoBehaviour:
m_Pos:
serializedVersion: 2
x: 0
y: 452
width: 548
height: 235
y: 638
width: 771
height: 361
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -904,22 +904,22 @@ MonoBehaviour:
m_SkipHidden: 0
m_SearchArea: 1
m_Folders:
- Assets/Scripts
- Assets
m_Globs: []
m_OriginalText:
m_ViewMode: 1
m_StartGridSize: 55
m_LastFolders:
- Assets/Scripts
- Assets
m_LastFoldersGridSize: 55
m_LastProjectPath: C:\dev\find the source
m_LastProjectPath: C:\dev\find the source\projekt\FindTheSource
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 486f0000
m_LastClickedID: 28488
m_ExpandedIDs: 00000000286f000000ca9a3bffffff7f
m_SelectedIDs: 44770000
m_LastClickedID: 30532
m_ExpandedIDs: 00000000447700004677000048770000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -947,7 +947,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000286f000000ca9a3bffffff7f
m_ExpandedIDs: 00000000447700004677000048770000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -1023,10 +1023,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1040
x: 1462
y: 73
width: 325
height: 614
width: 457
height: 926
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default