private void Awake() { _saveLoadScript.LoadGame(); _audioController.VolumeChange(_soundController.SoundCheck()); Action ChangeVolumeAction = () => _audioController.VolumeChange(_soundController.SoundCheck()); _signalManager._signalBus.Subscribe <AudioChange>(ChangeVolumeAction); }
// Use this for initialization public override void Start() { SaveLoadScript.LoadGame(); CharacterStats stats = SaveLoadScript.playerStats; // check if game was saved at least once, otherwise we put the player stats to null if (SaveLoadScript.saved == true) { base.characterStats = stats; GetComponent <PlayerScript> ().level = SaveLoadScript.playerLevel; GetComponent <PlayerScript> ().Exp = SaveLoadScript.playerXP; } canMoveX = true; rigidBody = GetComponent <Rigidbody2D>(); //Call the Parent's class start method base.Start(); groundCheckLayerMask = LayerMask.GetMask("Ground", "UndergroundGround"); //initial set of state variables IsAttacking = false; IsDodging = false; attackCounter = 0; weaponIndex = 0; firstAttack = true; setIsBlocking(false); IsTransforming = false; IsChargingAShot = false; initialGravityScale = ThisRigidBody.gravityScale; InvokeRepeating("staminaRegeneration", 0, 0.1f); InvokeRepeating("hpRegeneration", 0, 0.5f); audioSource1 = gameObject.AddComponent <AudioSource> (); audioSource2 = gameObject.AddComponent <AudioSource> (); audioSource3 = gameObject.AddComponent <AudioSource> (); audioSource3.clip = clips [2]; audioSource2.clip = clips [4]; }
void Start() { _camera = GameObject.Find("Main Camera").GetComponent <CameraController>(); Saveload = GameObject.Find("SaveLoadObject").GetComponent <SaveLoadScript>(); Saveload.LoadGame(); }
public void OnLoadClicked() { saveLoad.LoadGame(); }