Example #1
0
    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;
                }
            }
        }
    }
Example #2
0
    /// <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);
    }