lealeelu
8 years ago
9 changed files with 4446 additions and 1 deletions
@ -0,0 +1,71 @@ |
|||||||
|
// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). |
||||||
|
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) |
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using UnityEngine; |
||||||
|
|
||||||
|
namespace Fungus |
||||||
|
{ |
||||||
|
/// <summary> |
||||||
|
/// A single line of dialog |
||||||
|
/// </summary> |
||||||
|
[Serializable] |
||||||
|
public class Line |
||||||
|
{ |
||||||
|
public string name; |
||||||
|
public string text; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
[Serializable] |
||||||
|
public class HistoryData |
||||||
|
{ |
||||||
|
public List<Line> lines; |
||||||
|
|
||||||
|
public HistoryData() { |
||||||
|
lines = new List<Line>(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary> |
||||||
|
/// Controls dialog history |
||||||
|
/// </summary> |
||||||
|
public class HistoryManager : MonoBehaviour |
||||||
|
{ |
||||||
|
|
||||||
|
HistoryData history; |
||||||
|
|
||||||
|
protected virtual void Awake() |
||||||
|
{ |
||||||
|
history = new HistoryData(); |
||||||
|
} |
||||||
|
|
||||||
|
public void AddLine(string name, string text) |
||||||
|
{ |
||||||
|
Line line = new Line(); |
||||||
|
line.name = name; |
||||||
|
line.text = text; |
||||||
|
history.lines.Add(line); |
||||||
|
} |
||||||
|
|
||||||
|
public string GetHistory() |
||||||
|
{ |
||||||
|
string jsonText = JsonUtility.ToJson(history, true); |
||||||
|
return jsonText; |
||||||
|
} |
||||||
|
|
||||||
|
public string GetPrettyHistory() |
||||||
|
{ |
||||||
|
string output = ""; |
||||||
|
|
||||||
|
for (int i = 0; i < history.lines.Count; i++) |
||||||
|
{ |
||||||
|
output += "<b>" + history.lines[i].name + "</b>\n"; |
||||||
|
output += history.lines[i].text + "\n\n"; |
||||||
|
} |
||||||
|
return output; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: c55d0d498086c9f4dabf854988212ae9 |
||||||
|
timeCreated: 1486763938 |
||||||
|
licenseType: Pro |
||||||
|
MonoImporter: |
||||||
|
serializedVersion: 2 |
||||||
|
defaultReferences: [] |
||||||
|
executionOrder: 0 |
||||||
|
icon: {instanceID: 0} |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,68 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 94b4465d12d983b45a5c1af59318e72e |
||||||
|
timeCreated: 1486825113 |
||||||
|
licenseType: Pro |
||||||
|
TextureImporter: |
||||||
|
fileIDToRecycleName: {} |
||||||
|
serializedVersion: 4 |
||||||
|
mipmaps: |
||||||
|
mipMapMode: 0 |
||||||
|
enableMipMap: 0 |
||||||
|
sRGBTexture: 1 |
||||||
|
linearTexture: 0 |
||||||
|
fadeOut: 0 |
||||||
|
borderMipMap: 0 |
||||||
|
mipMapFadeDistanceStart: 1 |
||||||
|
mipMapFadeDistanceEnd: 3 |
||||||
|
bumpmap: |
||||||
|
convertToNormalMap: 0 |
||||||
|
externalNormalMap: 0 |
||||||
|
heightScale: 0.25 |
||||||
|
normalMapFilter: 0 |
||||||
|
isReadable: 0 |
||||||
|
grayScaleToAlpha: 0 |
||||||
|
generateCubemap: 6 |
||||||
|
cubemapConvolution: 0 |
||||||
|
seamlessCubemap: 0 |
||||||
|
textureFormat: 1 |
||||||
|
maxTextureSize: 2048 |
||||||
|
textureSettings: |
||||||
|
filterMode: -1 |
||||||
|
aniso: -1 |
||||||
|
mipBias: -1 |
||||||
|
wrapMode: 1 |
||||||
|
nPOTScale: 0 |
||||||
|
lightmap: 0 |
||||||
|
compressionQuality: 50 |
||||||
|
spriteMode: 1 |
||||||
|
spriteExtrude: 1 |
||||||
|
spriteMeshType: 1 |
||||||
|
alignment: 0 |
||||||
|
spritePivot: {x: 0.5, y: 0.5} |
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
||||||
|
spritePixelsToUnits: 100 |
||||||
|
alphaUsage: 1 |
||||||
|
alphaIsTransparency: 1 |
||||||
|
spriteTessellationDetail: -1 |
||||||
|
textureType: 8 |
||||||
|
textureShape: 1 |
||||||
|
maxTextureSizeSet: 0 |
||||||
|
compressionQualitySet: 0 |
||||||
|
textureFormatSet: 0 |
||||||
|
platformSettings: |
||||||
|
- buildTarget: DefaultTexturePlatform |
||||||
|
maxTextureSize: 2048 |
||||||
|
textureFormat: -1 |
||||||
|
textureCompression: 1 |
||||||
|
compressionQuality: 50 |
||||||
|
crunchedCompression: 0 |
||||||
|
allowsAlphaSplitting: 0 |
||||||
|
overridden: 0 |
||||||
|
spriteSheet: |
||||||
|
serializedVersion: 2 |
||||||
|
sprites: [] |
||||||
|
outline: [] |
||||||
|
spritePackingTag: |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue