void Start() { generated = false; hubTracker = GameObject.Find("Persistent Object").GetComponent <HUBTracker>(); invMgr = GameObject.Find("Persistent Object").GetComponent <InventoryManager>(); currentCash = invMgr.currency; }
private void Awake() { greenUnit = GameObject.Find("AISphere Green"); blueUnit = GameObject.Find("AISphere Blue"); orangeUnit = GameObject.Find("AISphere Orange"); hubTracker = GameObject.Find("Persistent Object").GetComponent <HUBTracker>(); commSubPanel = GameObject.Find("RunningUI/Commands Group/Command Sub-Panel"); aiControlGreen = greenUnit.GetComponent <AIMachine>(); aiControlBlue = blueUnit.GetComponent <AIMachine>(); aiControlOrange = orangeUnit.GetComponent <AIMachine>(); foreach (Transform button in commSubPanel.GetComponentsInChildren <Transform>()) { cmdButtons.Add(button.gameObject); } blueSelected = false; greenSelected = false; orangeSelected = false; leadTargeted = false; blueTargeted = false; greenTargeted = false; orangeTargeted = false; for (int i = 0; i < cmdButtons.Count; i++) //use this for loop to determine what buttons should be deactivated before the level starts { if (cmdButtons[i].name.Contains("Heal")) { cmdButtons[i].SetActive(false); } } }
private void Awake() { uiManager = GetComponent <UIManager>(); hubTracker = GetComponent <HUBTracker>(); soundMgr = GetComponent <SoundManager>(); invMgr = GetComponent <InventoryManager>(); saveMgr = GetComponent <SaveFileManager>(); }
void Start() { laserLine = GetComponent <LineRenderer>(); laserLine.enabled = false; gameManager = GameObject.Find("Persistent Object").GetComponent <GameManager>(); hubTracker = GameObject.Find("Persistent Object").GetComponent <HUBTracker>(); botStats = GetComponent <BotStats>(); canvasCaster = GameObject.Find("RunningUI").GetComponent <GraphicRaycaster>(); eventSys = GameObject.Find("EventSystem").GetComponent <EventSystem>(); displayLog = GameObject.Find("RunningUI/Text Log/Log Panel/Content").GetComponent <DisplayLog>(); animator = GetComponent <Animator>(); audioS = GetComponent <AudioSource>(); hitCanvas = false; }
void Start() { hubTracker = GameObject.Find("Persistent Object").GetComponent <HUBTracker>(); health = GetComponent <Health>(); if (!GetComponent <PlayerMove>()) { SetStatBonuses(); SetPerkBonuses(); } else { SetPlayerStatBonuses(); } Debug.Log("bot stats start finished"); }
private void Awake() { hubTracker = GameObject.Find("Persistent Object").GetComponent <HUBTracker>(); equipInv = GameObject.Find("HUBUI/Loadout Panel/Equipment Grid").GetComponent <Inventory>(); invManager = GameObject.Find("Persistent Object").GetComponent <InventoryManager>(); showPerks = GameObject.Find("HUBUI/Loadout Panel/Perk Group").GetComponent <ShowPerks>(); botStats.points = GameObject.Find("HUBUI/Loadout Panel/Points #").GetComponent <TextMeshProUGUI>(); botStats.levelText = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Level #").GetComponent <TextMeshProUGUI>(); botStats.expText = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Exp #").GetComponent <TextMeshProUGUI>(); botStats.expSlider = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Exp Slider").GetComponent <Slider>(); botStats.str = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (1)/Strength #").GetComponent <TextMeshProUGUI>(); botStats.elec = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (1)/Electronics #").GetComponent <TextMeshProUGUI>(); botStats.agi = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (1)/Agility #").GetComponent <TextMeshProUGUI>(); botStats.cbt = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (1)/Combat #").GetComponent <TextMeshProUGUI>(); botStats.scan = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (3)/Scanning #").GetComponent <TextMeshProUGUI>(); botStats.eff = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (3)/Efficiency #").GetComponent <TextMeshProUGUI>(); botStats.hit = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (3)/Heavy Hitter #").GetComponent <TextMeshProUGUI>(); botStats.ret = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (3)/Retention #").GetComponent <TextMeshProUGUI>(); botStats.def = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (5)/Defender #").GetComponent <TextMeshProUGUI>(); botStats.objM = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (5)/Objective Master #").GetComponent <TextMeshProUGUI>(); botStats.regen = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (5)/Regenerator #").GetComponent <TextMeshProUGUI>(); botStats.luck = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (5)/Lucky #").GetComponent <TextMeshProUGUI>(); botStats.teamP = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (5)/Team Player #").GetComponent <TextMeshProUGUI>(); botStats.info = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Vertical Group (5)/Informant #").GetComponent <TextMeshProUGUI>(); botStats.specialization = GameObject.Find("HUBUI/Loadout Panel/Stats Backing/Spec Button Backing/Specialization").GetComponent <TextMeshProUGUI>(); leadName = GameObject.Find("HUBUI/Loadout Panel/Horizontal Group Names/Lead Bot Name").GetComponent <TextMeshProUGUI>(); blueName = GameObject.Find("HUBUI/Loadout Panel/Horizontal Group Names/Blue Bot Name").GetComponent <TextMeshProUGUI>(); greenName = GameObject.Find("HUBUI/Loadout Panel/Horizontal Group Names/Green Bot Name").GetComponent <TextMeshProUGUI>(); orangeName = GameObject.Find("HUBUI/Loadout Panel/Horizontal Group Names/Orange Bot Name").GetComponent <TextMeshProUGUI>(); leadStats = true; blueStats = false; greenStats = false; orangeStats = false; botStats.specialization.text = "No Specialization"; leadName.color = new Color32(0, 200, 30, 255); }
public static void SaveData(HUBTracker tracker, InventoryManager manager, string fileName) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/" + fileName + ".plr"; FileStream stream = new FileStream(path, FileMode.Create); PlayerData data = new PlayerData(tracker); formatter.Serialize(stream, data); Debug.Log("Data saved to file at " + path); string path1 = Application.persistentDataPath + "/" + fileName + ".inv"; FileStream stream1 = new FileStream(path1, FileMode.Create); InventoryData data1 = new InventoryData(manager); formatter.Serialize(stream1, data1); Debug.Log("Data saved to file at " + path1); stream.Close(); stream1.Close(); }
private void Awake() { uiMgr = GetComponent <UIManager>(); hubTracker = GetComponent <HUBTracker>(); saveMgr = GetComponent <SaveFileManager>(); }
private void Start() { tracker = GameObject.Find("Persistent Object").GetComponent <HUBTracker>(); manager = GameObject.Find("Persistent Object").GetComponent <InventoryManager>(); saveInfo = GameObject.Find("Persistent Object").GetComponent <SaveFileManager>(); }
private void Awake() { manager = GetComponent <InventoryManager>(); tracker = GetComponent <HUBTracker>(); }
public PlayerData(HUBTracker tracker) { for (int i = 0; i < 4; i++) { var currentStruct = new HUBTracker.botStruct(); var currentBot = new botData(); if (i == 0) { currentStruct = tracker.leadBot; currentBot = leadBot; } else if (i == 1) { currentStruct = tracker.blueBot; currentBot = blueBot; } else if (i == 2) { currentStruct = tracker.greenBot; currentBot = greenBot; } else if (i == 3) { currentStruct = tracker.orangeBot; currentBot = orangeBot; } currentBot.points = currentStruct.points; currentBot.level = currentStruct.level; currentBot.exp = currentStruct.exp; currentBot.strength = currentStruct.strength; currentBot.electronics = currentStruct.electronics; currentBot.agility = currentStruct.agility; currentBot.combat = currentStruct.combat; currentBot.scanning = currentStruct.scanning; currentBot.efficiency = currentStruct.efficiency; currentBot.heavyHitter = currentStruct.heavyHitter; currentBot.retention = currentStruct.retention; currentBot.defender = currentStruct.defender; currentBot.objMaster = currentStruct.objMaster; currentBot.regenerator = currentStruct.regenerator; currentBot.lucky = currentStruct.lucky; currentBot.teamPlayer = currentStruct.teamPlayer; currentBot.informant = currentStruct.informant; currentBot.spec = currentStruct.spec; if (i == 0) { leadBot = currentBot; } else if (i == 1) { blueBot = currentBot; } else if (i == 2) { greenBot = currentBot; } else if (i == 3) { orangeBot = currentBot; } } }