Skip to content
This repository has been archived by the owner on Feb 19, 2018. It is now read-only.

Commit

Permalink
scripts working
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrés committed Feb 7, 2016
1 parent 38de12c commit f100387
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 8 deletions.
17 changes: 17 additions & 0 deletions Assets/CanvasController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;


public class CanvasController : MonoBehaviour {
public BookShelf shelf;

void Next(){
shelf.NextPage ();
}
void Exit(){
Text txt = this.GetComponentInChildren<Text> ();
txt.text= "";
this.GetComponent<Canvas> ().enabled = false;
}
}
12 changes: 12 additions & 0 deletions Assets/CanvasController.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Assets/CanvasDisable.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using UnityEngine;
using System.Collections;


public class CanvasDisable : MonoBehaviour {

// Use this for initialization
Expand Down
21 changes: 15 additions & 6 deletions Assets/Scripts/BookShelf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,29 @@
public class BookShelf : TextDownload {
private GameObject canvas;
private Canvas canvasComponent;
private CanvasController canvasController;
private BookPosition book;
void Start () {
canvas = GameObject.Find ("Canvas");
canvasComponent = canvas.GetComponent<Canvas> ();
}

void Interaction(){
Debug.Log ("Interaction");
canvasComponent.enabled = true;
BookPosition book;
canvasController = canvas.GetComponent<CanvasController> ();

book.room = "1";
book.wall = 1;
book.shelf = 1;
book.volume = 1;
book.page = 1;
}

void Interaction(){
Debug.Log ("Interaction");
canvasComponent.enabled = true;
canvasController.shelf = this;
GetPage(book);
}
public void NextPage(){
book.page++;
Debug.Log (book.page);
GetPage(book);
}

Expand Down
6 changes: 5 additions & 1 deletion Assets/Scripts/TextDownload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ private static string ParseTitle(string html){
return title;
}
private static string generateUrl(BookPosition book){
string fullUrl = url + "?" + book.room + "-w" + book.wall + "-s" + book.shelf + "-v" + book.volume + ":" + book.page;
string volume = book.volume.ToString ();
if (book.volume < 10)
volume = "0" + volume;
string fullUrl = url + "?" + book.room + "-w" + book.wall + "-s" + book.shelf + "-v" + volume + ":" + book.page;
Debug.Log (fullUrl);
return fullUrl;
}

Expand Down
Binary file modified Assets/_Scene/TestInteraction.unity
Binary file not shown.
Binary file modified ProjectSettings/ProjectSettings.asset
Binary file not shown.
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 5.1.0f3
m_EditorVersion: 5.1.1f1
m_StandardAssetsVersion: 0

0 comments on commit f100387

Please sign in to comment.