Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Kopernicus/Kopernicus
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 629a9d7dd57a
Choose a base ref
...
head repository: Kopernicus/Kopernicus
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 39d45ab565f0
Choose a head ref
  • 3 commits
  • 1 file changed
  • 1 contributor

Commits on Dec 6, 2018

  1. KopernicusSunFlare fix

    deleting a KopernicusSunFlare was causing me all kinds of issues
    
    this fixed it in my tests
    Sigma88 authored Dec 6, 2018
    Copy the full SHA
    bc7c660 View commit details

Commits on Dec 8, 2018

  1. Copy the full SHA
    e5dae67 View commit details
  2. Copy the full SHA
    39d45ab View commit details
Showing with 17 additions and 9 deletions.
  1. +17 −9 src/Kopernicus.Components/KopernicusSunFlare.cs
26 changes: 17 additions & 9 deletions src/Kopernicus.Components/KopernicusSunFlare.cs
Original file line number Diff line number Diff line change
@@ -40,15 +40,23 @@ public class KopernicusSunFlare : SunFlare
{
protected override void Awake()
{
// sun flare
Camera.onPreCull += cam =>
{
Vector3d scaledSpace = target.transform.position - ScaledSpace.LocalToScaledSpace(sun.position);
sunDirection = scaledSpace.normalized;
if (sunDirection != Vector3d.zero)
transform.forward = sunDirection;
};
Camera.onPreCull += OnPreCull;
}

void OnPreCull(Camera camera)
{
Vector3d scaledSpace = target.transform.position - ScaledSpace.LocalToScaledSpace(sun.position);
sunDirection = scaledSpace.normalized;
if (sunDirection != Vector3d.zero)
transform.forward = sunDirection;
}

protected override void OnDestroy()
{
Camera.onPreCull -= OnPreCull;

base.OnDestroy();
}
}
}
}
}