/// <summary> /// Sets the book object and initialize all the book data gameobjects /// </summary> public void SetBookObject(GameObject bookObject) { mBookObject = bookObject; Transform bookTransform = bookObject.transform; mBookTitle = bookTransform.Find("BookData/BookTitle").GetComponent<TextMesh>(); mBookAuthor = bookTransform.Find("BookData/BookAuthor").GetComponent<TextMesh>(); mBookRegularPrice = bookTransform.Find("BookData/RegularPriceObjects/RegularPrice").GetComponent<TextMesh>(); mBookOverallRatings = bookTransform.Find("BookData/RatingObjects/RatingsText").GetComponent<TextMesh>(); mBookYourPrice = bookTransform.Find("BadgeObjects/BadgeBackground/DiscountPrice").GetComponent<TextMesh>(); mBookStarsRating = bookTransform.Find("BookData/RatingObjects/StarsContainer").GetComponent<StarsRatingControl>(); mBookThumb = bookTransform.Find("BookThumb").gameObject; GameObject touchForMoreInfoObject = mBookObject.transform.Find("TouchForMoreInformation").gameObject; if(touchForMoreInfoObject != null ) { touchForMoreInfoObject.GetComponent<TextMesh>().renderer.material.SetColor("_Color",new Color(0.2f, 0.7098f, 0.898f,1)); } }
/// <summary> /// Sets the book object and initialize all the book data gameobjects /// </summary> public void SetBookObject(GameObject bookObject) { mBookObject = bookObject; Transform bookTransform = bookObject.transform; mBookTitle = bookTransform.Find("BookData/BookTitle").GetComponent <TextMesh>(); mBookAuthor = bookTransform.Find("BookData/BookAuthor").GetComponent <TextMesh>(); mBookRegularPrice = bookTransform.Find("BookData/RegularPriceObjects/RegularPrice").GetComponent <TextMesh>(); mBookOverallRatings = bookTransform.Find("BookData/RatingObjects/RatingsText").GetComponent <TextMesh>(); mBookYourPrice = bookTransform.Find("BadgeObjects/BadgeBackground/DiscountPrice").GetComponent <TextMesh>(); mBookStarsRating = bookTransform.Find("BookData/RatingObjects/StarsContainer").GetComponent <StarsRatingControl>(); mBookThumb = bookTransform.Find("BookThumb").gameObject; GameObject touchForMoreInfoObject = mBookObject.transform.Find("TouchForMoreInformation").gameObject; if (touchForMoreInfoObject != null) { touchForMoreInfoObject.GetComponent <TextMesh>().renderer.material.SetColor("_Color", new Color(0.2f, 0.7098f, 0.898f, 1)); } }