Example #1
0
    public void Initialize()
    {
        shapes.Clear();

        mainShape.maskType         = maskType;
        mainShape.maskPivot        = maskPivot;
        mainShape.maskTranslucency = maskTranslucency;

        mainShape.shadowType         = shadowType;
        mainShape.shadowDistance     = shadowDistance;
        mainShape.shadowTranslucency = shadowTranslucency;

        mainShape.SetTransform(transform);
        mainShape.transform2D.Reset();
        mainShape.transform2D.Update();
        mainShape.transform2D.UpdateNeeded = true;

        shapes.Add(mainShape);

        if (applyToChildren)
        {
            AddChildShapes(transform);
        }

        foreach (LightColliderShape shape in shapes)
        {
            shape.ResetLocal();
        }
    }
Example #2
0
    private void AddChildShapes(Transform parent)
    {
        foreach (Transform child in parent)
        {
            LightColliderShape shape = new LightColliderShape();
            shape.maskType         = mainShape.maskType;
            shape.maskPivot        = mainShape.maskPivot;
            shape.maskTranslucency = mainShape.maskTranslucency;

            shape.shadowType         = mainShape.shadowType;
            shape.shadowDistance     = mainShape.shadowDistance;
            shape.shadowTranslucency = mainShape.shadowTranslucency;

            shape.SetTransform(child);
            shape.transform2D.Update();

            shapes.Add(shape);

            AddChildShapes(child);
        }
    }