Skip to content
Snippets Groups Projects
Commit 93c04775 authored by BenniHome's avatar BenniHome
Browse files

automagic- scrollgeneration begun

parent 83d85638
No related branches found
No related tags found
No related merge requests found
fileFormatVersion: 2
guid: 3e44188233dad5a46960775c96d1243a
guid: eec83b50c1e0c604aa91430f72c8dbb0
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.UI;
public class DisplayScrolls : MonoBehaviour
{
//public Inventory inventory;
public List<Scroll> scrolls = new List<Scroll>();
public int x_Start;
......@@ -13,11 +15,7 @@ public class DisplayScrolls : MonoBehaviour
public int X_Pacece_Between_Items;
public int y_Pacece_Between_Items;
public int number_of_Column;
// Start is called before the first frame update
void Start()
{
//CreateDisplay();
}
// Update is called once per frame
void Update()
......@@ -43,4 +41,16 @@ public Vector3 GetPosition(int i)
{
return new Vector3(x_Start+ (X_Pacece_Between_Items * (i % number_of_Column)), y_Start + (-y_Pacece_Between_Items * (i / number_of_Column)), 0f);
}
// Start is called before the first frame update
void Start()
{
string path = "Mock-Scrolls.json";
string jsonString = File.ReadAllText(path);
jsonString = jsonString.Replace(System.Environment.NewLine, "");
jsonString = jsonString.Replace("\t", "");
Debug.Log(jsonString);
Scroll[] scrollsRead = JsonUtility.FromJson<Scroll[]>(jsonString);
//this.scrolls = scrollsRead;
}
}
Assets/InventoryStuff/Items/images/ScrollBackground.png

129 B

fileFormatVersion: 2
guid: 9c9625e4f27b7c44ebc26d1292ff2092
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 54e1f033ae4f7ea4f98f3cde1bbd535c
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
[Serializable]
public class Declaration
{
public string name;
public string type;
public string identifier;
}
[Serializable]
public class Scroll
{
public string problemTheory;
public string solutionTheory;
public string label;
public string description;
public Declaration[] declarations;
//public string output;
public static Scroll generateFromJson(string json) {
return JsonUtility.FromJson<Scroll>(json);
}
public string toJson() {
return JsonUtility.ToJson(this);
}
}
fileFormatVersion: 2
guid: 1239c930b6f32aa4a9e3356b102b7baf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: efd7037a57100574780bb26bea0c0683
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: ac72be71662640f4ab0aaf102090fb95
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
[
{
"problemTheory": "bla",
"solutioTheory": "blubb",
"label": "Pythagoras",
"description": "a quadrat plus b quadrat ist c quadrat",
"declarations": [
{
"name": "PointA",
"type": "Point",
"identifier": "URI"
},
{
"name": "PointB",
"type": "Point",
"identifier": "URI"
}
,
{
"name": "PointC",
"type": "Point",
"identifier": "URI"
}
,
{
"name": "Distance AC",
"type": "Distance",
"identifier": "URI"
}
,
{
"name": "Distance BC",
"type": "Point",
"identifier": "URI"
}
,
{
"name": "Angle ACB",
"type": "Angle",
"identifier": "URI"
}
]
},
{
"problemTheory": "bla",
"solutioTheory": "blubb",
"label": "Tangens",
"description": "Das standart Beispiel für FRAMEIT",
"declarations": [
{
"name": "PointA",
"type": "Point",
"identifier": "URI"
},
{
"name": "PointB",
"type": "Point",
"identifier": "URI"
}
,
{
"name": "PointC",
"type": "Point",
"identifier": "URI"
},
{
"name": "Distance AC",
"type": "Distance",
"identifier": "URI"
}
,
{
"name": "Angle CAB",
"type": "Angle",
"identifier": "URI"
}
,
{
"name": "Angle ACB",
"type": "Angle",
"identifier": "URI"
}
]
}
]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment