public override void Initialize(StateMachine owner) { this.owner = (PlayerStateMashine)owner; OwnerPhysics.SetAirResistance(0.95f); CurrentTorchDuration = TimerLifetime; SpawnPoint = Position.position; }
public Data(PlayerStateMashine player) { Health = player.Health; Position = new float[3]; Position[0] = player.transform.position.x; Position[1] = player.transform.position.y; Position[2] = player.transform.position.z; }
public static void SetPlayerState(PlayerStateMashine playerInfo) { SaveInformation.CurrentHealth = playerInfo.Health; SaveInformation.Position = new float[3]; SaveInformation.Position[0] = playerInfo.transform.position.x; SaveInformation.Position[1] = playerInfo.transform.position.y; SaveInformation.Position[2] = playerInfo.transform.position.z; }
public static void SaveData(PlayerStateMashine player) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/save.info"; FileStream stream = new FileStream(path, FileMode.Create); Data data = new Data(player); formatter.Serialize(stream, data); stream.Close(); }
public static SaveData2 GetPlayerState(PlayerStateMashine playerInfo) { return(SaveInformation); }