void Awake() { selectScreen = false; shopExplorer = transform.parent.GetComponent <ShopExplorerBehavior>(); // Find all the objects from the children colorObject = transform.Find(COLOR_OBJECT).gameObject; frontObject = transform.Find(FRONT_OBJECT).gameObject; nameObjectFront = frontObject.transform.Find(NAME_OBJECT).gameObject; imageObjectFront = frontObject.transform.Find(IMAGE_OBJECT).gameObject; priceObjectFront = frontObject.transform.Find(PRICE_OBJECT).gameObject; backObject = transform.Find(BACK_OBJECT).gameObject; nameObjectBack = backObject.transform.Find(NAME_OBJECT).gameObject; imageObjectBack = backObject.transform.Find(IMAGE_OBJECT).gameObject; priceObjectBack = backObject.transform.Find(PRICE_OBJECT).gameObject; descriptionObjectBack = backObject.transform.Find(DESCRIPTION_OBJECT).gameObject; cartObjectBack = backObject.transform.Find(CART_OBJECT).gameObject; cartIncreaseObjectBack = cartObjectBack.transform.Find(CART_INCREASE_OBJECT).gameObject; cartDecreaseObjectBack = cartObjectBack.transform.Find(CART_DECREASE_OBJECT).gameObject; cartAddToCartObjectBack = cartObjectBack.transform.Find(CART_ADDTOCART_OBJECT).gameObject; // Memorize a couple values for the thumbnail defaultTexture = imageObjectFront.GetComponent <Renderer>().material.mainTexture; imgScaleFront = imageObjectFront.transform.localScale; imgScaleBack = imageObjectBack.transform.localScale; }
void Start() { trackedObj = GetComponent <SteamVR_TrackedObject>(); // Replace the prefabs with clones at startup laserVisuals = GameObject.Instantiate(laserVisuals, transform); laserCollider = GameObject.Instantiate(laserCollider, transform); // Get the template outline object outlineComponent = GetComponent <Outline>(); // Get the shop explorer if (shopExplorer != null) { explorer = shopExplorer.GetComponent <ShopExplorerBehavior>(); } }
void Start() { shopExplorer = transform.parent.GetComponent <ShopExplorerBehavior>(); }
void Awake() { shopExplorer = transform.parent.GetComponent <ShopExplorerBehavior>(); markerBoxScale = positionMarkerBox.transform.localScale.x; }