Exemplo n.º 1
0
 public override void Initialize(StateMachine owner)
 {
     this.owner = (PlayerStateMashine)owner;
     OwnerPhysics.SetAirResistance(0.95f);
     CurrentTorchDuration = TimerLifetime;
     SpawnPoint           = Position.position;
 }
Exemplo n.º 2
0
    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;
    }
Exemplo n.º 3
0
    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;
    }
Exemplo n.º 4
0
    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();
    }
Exemplo n.º 5
0
 public static SaveData2 GetPlayerState(PlayerStateMashine playerInfo)
 {
     return(SaveInformation);
 }