Posted November 21, 2017 by Hopeless
Our Game Teaser on Youtube
Script for open a book :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Book : MonoBehaviour {
public Camera mainCamera;
public GameObject book;
public GameObject bookPosition;
public static GameObject bookclone;
public static int countBook;
public static bool clicked = false;
void OnMouseDown(){
Debug.Log (gameObject.name);
//clicked = !clicked;
charMoving.speed = 0f;
bookclone = Instantiate (book, bookPosition.transform.position, Quaternion.identity);
bookclone.transform.parent = mainCamera.transform;
UIInventory.have = true;
}
}