Пример #1
0
    protected override void OnStart()
    {
        mCol = planeRenderer.GetComponent <BoxCollider>();
        if (mCol == null)
        {
            mCol = NJGTools.AddWidgetCollider(planeRenderer.gameObject);
            if (mCol.size != new Vector3(10, 0, 10))
            {
                mCol.size = new Vector3(10, 0, 10);
            }
        }

        if (NJG.NJGMapBase.instance == null)
        {
            return;
        }

        if (planeRenderer != null)
        {
            if (material == null)
            {
                Debug.LogWarning("The UITexture does not have a material assigned", this);
            }
            else
            {
                if (NJG.NJGMapBase.instance.generateMapTexture)
                {
                    material.mainTexture = mapOnGUI.mapTexture;
                }
                //else
                //	material.mainTexture = NJG.NJGMapBase.instance.userMapTexture;

                //if (maskTexture != null) material.SetTexture("_Mask", maskTexture);
            }

            material.color = mapColor;
        }
        base.OnStart();

        if (iconRoot != null)
        {
            iconRoot.localEulerAngles = Vector3.zero;
            iconRoot.localPosition    = new Vector3(rendererTransform.localPosition.x, rendererTransform.localPosition.y, -1);
        }
    }
Пример #2
0
    protected override void OnStart()
    {
        base.OnStart();
        mCol = planeRenderer.GetComponent <BoxCollider>();
        if (mCol == null)
        {
            mCol = NJGTools.AddWidgetCollider(planeRenderer.gameObject);
            if (mCol.size != new Vector3(10, 0, 10))
            {
                mCol.size = new Vector3(10, 0, 10);
            }
        }

        if (iconRoot != null)
        {
            iconRoot.localEulerAngles = Vector3.zero;
        }
    }