private void copyToBillboard(bool renderLine, int color) { if (!imitateOnBillboar) { return; } BaseBillboard billboard = gameObject.GetComponent <BaseBillboard>(); if (billboard) { if (billboard.billboard) { var outlines = billboard.billboard.GetComponentsInChildren <Outline>(); foreach (var oLine in outlines) { oLine.eraseRenderer = !renderLine; oLine.color = color; } } } }
/// <summary> /// Creates relationship between mesh objects and billboards /// </summary> /// <returns></returns> private IEnumerator SetBillboards() { yield return(new WaitForSeconds(1)); var contents = shelf.GetComponentsInChildren <Billboard>(); foreach (var billbord in contents) { GameObject baseBill = GameObject.Find("/" + name + "/" + billbord.gameObject.name); if (baseBill) { BaseBillboard baseBillboard = baseBill.GetComponent <BaseBillboard>(); if (baseBillboard) { baseBillboard.billboard = billbord.gameObject; } } else { billbord.ActiveGrayEffetc(); } } yield return(null); }