void RPC_PlaypickUpSoundAndInstantiateParticleOnInteractableProduct(int index, int playSound, float destroyTime, Vector3 pos) { InteractableProduct ip = PhotonProductList.staticInteratableProductList[index]; if (playSound == 1) { ip.PlayInteractSound(); } if (ip.interactParticle) { GameObject ps = Instantiate(ip.interactParticle, pos, Quaternion.identity); Destroy(ps, destroyTime); } }
private void DistanceCheck(Outline outlineObj, SpecialLookAtTxt slat) { text_ProductName.text = ""; if (hit.distance < storage.interactRange) { if (outlineObj) { PowerUp pu = hit.transform.gameObject.GetComponent <PowerUp>(); bool canShow = true; if (pu && pu.currentPlace != Interactable.Place.InShelve && !controller.useableProduct && !pu.interactable) { canShow = false; } InteractableProduct ip = hit.transform.gameObject.GetComponent <InteractableProduct>(); if (ip) { text_ProductName.text = ip.scriptableProduct.productName; if (!ip.interactable) { canShow = false; } } if (!outlineObj.enabled && canShow) { lastOutline = outlineObj; outlineObj.enabled = true; } } if (slat) { text_ProductName.text = slat.hoverText; } if (storage.productsNeededInCurrentList == storage.productsGotten) { InteractableCashRegister icr = hit.transform.GetComponent <InteractableCashRegister>(); if (icr) { text_ProductName.text = icr.hoverText; } } } }
void SetProductList() { InteractableProduct[] interactableProductArray = FindObjectsOfType <InteractableProduct>(); List <InteractableProduct> ipList = new List <InteractableProduct>(); photonProductList.interactableProductList.Clear(); for (int i = 0; i < interactableProductArray.Length; i++) { InteractableProduct tempProduct = interactableProductArray[i]; ipList.Add(tempProduct); tempProduct.index = i; if (tempProduct.scriptableProduct) { tempProduct.scriptableProduct = Product.MakeInstance(tempProduct.scriptableProduct); tempProduct.scriptableProduct.index = i; } tempProduct.gameObject.layer = 11; EditorUtility.SetDirty(tempProduct); } photonProductList.interactableProductList = ipList; }