// Update is called once per frame void Update() { if (checkMaster == null) { checkMaster = GameObject.FindGameObjectsWithTag("GameMaster")[0].GetComponent <CheckpointMaster>(); } }
public SaveData(SkillSystemNew ssm, Health Health, GameManager gm, CheckpointMaster cm, PendantSystemNew ps) { health = Health.health; heartnum = Health.numOfHearts; exp = ssm.exp; gold = gm.collectibleCounter; pside1 = ps.pSide1; pside2 = ps.pSide2; baseequip = ssm.baseequip; slot1equip = ssm.slot1equip; slot2equip = ssm.slot2equip; slot3equip = ssm.slot3equip; meteorXP = ssm.meteorXP; meteorshowerXP = ssm.meteorshowerXP; greatswordXP = ssm.greatswordXP; conflagrationXP = ssm.conflagrationXP; iceprismXP = ssm.iceprismXP; iceballXP = ssm.iceballXP; frostblastXP = ssm.frostblastXP; vortexXP = ssm.vortexXP; rockblastXP = ssm.rockblastXP; beeXP = ssm.beeXP; mekigneerXP = ssm.mekigneerXP; stoneskinXP = ssm.stoneskinXP; voltdaggerXP = ssm.voltdaggerXP; lightlanceXP = ssm.lightlanceXP; chainlightXP = ssm.chainlightXP; balllightXP = ssm.balllightXP; //Water hasFoundWater1 = cm.hasFoundWater1; hasFoundWater2 = cm.hasFoundWater2; hasFoundWater3 = cm.hasFoundWater3; //Fire hasFoundFire1 = cm.hasFoundFire1; hasFoundFire2 = cm.hasFoundFire2; hasFoundFire3 = cm.hasFoundFire3; //Earth hasFoundEarth1 = cm.hasFoundEarth1; hasFoundEarth2 = cm.hasFoundEarth2; hasFoundEarth3 = cm.hasFoundEarth3; //Lightning hasFoundLt1 = cm.hasFoundLt1; hasFoundLt2 = cm.hasFoundLt2; hasFoundLt3 = cm.hasFoundLt3; //Levels hasFoundWaterLevel = cm.hasFoundWaterLevel; hasFoundFireLevel = cm.hasFoundFireLevel; hasFoundEarthLevel = cm.hasFoundEarthLevel; hasFoundLtLevel = cm.hasFoundLtLevel; }
// Use this for initialization void Start() { GetComponent <SpriteRenderer>().color = defaultColor; if (checkMaster == null) { checkMaster = GameObject.FindGameObjectsWithTag("GameMaster")[0].GetComponent <CheckpointMaster>(); } }
void Start() { camControler = GameObject.FindGameObjectWithTag("CameraController").GetComponent <CameraControler>(); timeMaster = GameObject.FindGameObjectWithTag("TimeMaster").GetComponent <TimeMaster>(); cpMaster = GameObject.FindGameObjectWithTag("cpMaster").GetComponent <CheckpointMaster>(); resetLevel = GameObject.FindGameObjectWithTag("LevelReset").GetComponent <ResetLevel>(); levelBlockade = GameObject.FindGameObjectWithTag("LevelBlockade"); levelBlockade.SetActive(false); }
public static void SaveGame(SkillSystemNew ssm, Health Health, GameManager gm, CheckpointMaster cm, PendantSystemNew ps) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/Game.oof"; FileStream stream = new FileStream(path, FileMode.Create); SaveData data = new SaveData(ssm, Health, gm, cm, ps); formatter.Serialize(stream, data); stream.Close(); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(instance); } else { Destroy(gameObject); } }
public void SaveGame() { GameObject GM = GameObject.Find("GameManager"); GameManager gamem = GM.GetComponent <GameManager>(); SkillSystemNew ssm = GM.GetComponent <SkillSystemNew>(); health = GameObject.Find("HealthUI").GetComponent <Health>(); cm = GameObject.Find("CheckpointMaster").GetComponent <CheckpointMaster>(); ps = GM.GetComponent <PendantSystemNew>(); SaveSystem.SaveGame(ssm, health, gamem, cm, ps); }
// Use this for initialization void Start() { checkpointMaster = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <CheckpointMaster>(); finalboss = GameObject.FindGameObjectWithTag("FinalBoss"); tc2d = GetComponent <TilemapCollider2D>(); tmr = GetComponent <TilemapRenderer>(); tc2d.enabled = false; tmr.enabled = false; camera = Camera.main.gameObject.GetComponent <CameraScript>(); bossTransform = GameObject.FindGameObjectWithTag("FinalBoss").transform; }
void Start() { rb2d = gameObject.GetComponent <Rigidbody2D>(); rb2d.isKinematic = false; anim = gameObject.GetComponent <Animator>(); if (GameObject.FindGameObjectWithTag("cpMaster") != null) { checkpointMaster = GameObject.FindGameObjectWithTag("cpMaster").GetComponent <CheckpointMaster>(); } if (GameObject.FindGameObjectWithTag("DeathBed") != null) { deadlyObjects = GameObject.FindGameObjectWithTag("DeathBed").GetComponent <KillPlayer>(); } if (GameObject.FindGameObjectWithTag("CameraShaker") != null) { cameraShaker = GameObject.FindGameObjectWithTag("CameraShaker").GetComponent <Shake>(); } if (GameObject.FindGameObjectWithTag("TimeMaster") != null) { timeMaster = GameObject.FindGameObjectWithTag("TimeMaster").GetComponent <TimeMaster>(); } if (GameObject.FindGameObjectWithTag("LevelReset") != null) { resetLevel = GameObject.FindGameObjectWithTag("LevelReset").GetComponent <ResetLevel>(); } if (GameObject.FindGameObjectWithTag("GameOverScreen") != null) { gameOverScreen = GameObject.FindGameObjectWithTag("GameOverScreen"); gameOverScreen.SetActive(false); } dash = gameObject.GetComponent <Dash>(); }
void Start() { cm = GameObject.FindGameObjectWithTag("cm").GetComponent <CheckpointMaster>(); gm = GameObject.Find("GameManager"); }
public void LoadGame() { GameObject GM = GameObject.Find("GameManager"); GameManager gamem = GM.GetComponent <GameManager>(); SkillSystemNew ssm = GM.GetComponent <SkillSystemNew>(); health = GameObject.Find("HealthUI").GetComponent <Health>(); cm = GameObject.Find("CheckpointMaster").GetComponent <CheckpointMaster>(); ps = GM.GetComponent <PendantSystemNew>(); SaveData data = SaveSystem.LoadGame(); gamem.collectibleCounter = data.gold; health.health = data.health; ssm.exp = data.exp; health.numOfHearts = data.heartnum; ps.pSide1 = data.pside1; ps.pSide2 = data.pside2; ssm.baseequip = data.baseequip; ssm.slot1equip = data.slot1equip; ssm.slot2equip = data.slot2equip; ssm.slot3equip = data.slot3equip; ssm.meteorXP = data.meteorXP; ssm.meteorshowerXP = data.meteorshowerXP; ssm.greatswordXP = data.greatswordXP; ssm.conflagrationXP = data.conflagrationXP; ssm.iceprismXP = data.iceprismXP; ssm.iceballXP = data.iceballXP; ssm.frostblastXP = data.frostblastXP; ssm.vortexXP = data.vortexXP; ssm.rockblastXP = data.rockblastXP; ssm.beeXP = data.beeXP; ssm.mekigneerXP = data.mekigneerXP; ssm.stoneskinXP = data.stoneskinXP; ssm.voltdaggerXP = data.voltdaggerXP; ssm.lightlanceXP = data.lightlanceXP; ssm.chainlightXP = data.chainlightXP; ssm.balllightXP = data.balllightXP; //Water cm.hasFoundWater1 = data.hasFoundWater1; cm.hasFoundWater2 = data.hasFoundWater2; cm.hasFoundWater3 = data.hasFoundWater3; //Fire cm.hasFoundFire1 = data.hasFoundFire1; cm.hasFoundFire2 = data.hasFoundFire2; cm.hasFoundFire3 = data.hasFoundFire3; //Earth cm.hasFoundEarth1 = data.hasFoundEarth1; cm.hasFoundEarth2 = data.hasFoundEarth2; cm.hasFoundEarth3 = data.hasFoundEarth3; //Lightning cm.hasFoundLt1 = data.hasFoundLt1; cm.hasFoundLt2 = data.hasFoundLt2; cm.hasFoundLt3 = data.hasFoundLt3; //Levels cm.hasFoundWaterLevel = data.hasFoundWaterLevel; cm.hasFoundFireLevel = data.hasFoundFireLevel; cm.hasFoundEarthLevel = data.hasFoundEarthLevel; cm.hasFoundLtLevel = data.hasFoundLtLevel; if (data.health <= 3) { health.health = 3; } if (data.heartnum > 3) { if (data.heartnum == 4) { health.Heal(); } if (data.heartnum == 5) { health.Heal(); health.Heal(); } } }
private void Awake() { TPUI = GameObject.Find("TPUI"); cm = GameObject.FindGameObjectWithTag("cm").GetComponent <CheckpointMaster>(); gameman = GameObject.Find("GameManager"); }
// Start is called before the first frame update void Awake() { cm = GameObject.FindGameObjectWithTag("cm").GetComponent <CheckpointMaster>(); }
void Start() { cpMaster = GameObject.FindGameObjectWithTag("cpMaster").GetComponent <CheckpointMaster>(); }