Skip to content

Commit

Permalink
Minor fixes, check desc
Browse files Browse the repository at this point in the history
Types now check for bakery in project, prevents errors if bakery not in project
Added bakery to assembly definition or else cannot be seen
Renamed types to better fit format
  • Loading branch information
arranash committed Mar 2, 2024
1 parent 8a7fd63 commit 011d4fb
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 16 deletions.
8 changes: 8 additions & 0 deletions EQS_Types/Bakery.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#if UNITY_EDITOR
#if UNITY_EDITOR && BAKERY_INCLUDED
using UnityEditor;
using UnityEngine;
using EasyQuestSwitch.Fields;

namespace EasyQuestSwitch.Types
{
[AddComponentMenu("")]
public class Type_BakeryDirectLight : Type_Base
public class Type_Bakery_DirectLight : Type_Base
{
[System.NonSerialized]
private BakeryPointLight type;

private BakeryDirectLight type;

public SharedColor color = new SharedColor();
public SharedFloat intensity = new SharedFloat();
Expand All @@ -22,8 +21,8 @@ public class Type_BakeryDirectLight : Type_Base

public override void Setup(Object type)
{
// base.Setup(type);

// base.Setup(type);
BakeryDirectLight component = (BakeryDirectLight)type;
color.Setup(component.color);
intensity.Setup(component.intensity);
Expand All @@ -36,7 +35,7 @@ public override void Setup(Object type)

public override void Process(Object type, BuildTarget buildTarget)
{
// base.Process(type, buildTarget);
// base.Process(type, buildTarget);
BakeryDirectLight component = (BakeryDirectLight)type;
component.color = color.Get(buildTarget);
component.intensity = intensity.Get(buildTarget);
Expand All @@ -49,4 +48,4 @@ public override void Process(Object type, BuildTarget buildTarget)
}
}
}
#endif
#endif
11 changes: 11 additions & 0 deletions EQS_Types/Bakery/Type_Bakery_DirectLight.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#if UNITY_EDITOR
#if UNITY_EDITOR && BAKERY_INCLUDED
using UnityEditor;
using UnityEngine;
using EasyQuestSwitch.Fields;

namespace EasyQuestSwitch.Types
{
[AddComponentMenu("")]
public class Type_BakeryLightMesh : Type_Base
public class Type_Bakery_LightMesh : Type_Base
{
[System.NonSerialized]
private BakeryLightMesh type;
Expand Down
11 changes: 11 additions & 0 deletions EQS_Types/Bakery/Type_Bakery_LightMesh.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#if UNITY_EDITOR
#if UNITY_EDITOR && BAKERY_INCLUDED
using UnityEditor;
using UnityEngine;
using EasyQuestSwitch.Fields;

namespace EasyQuestSwitch.Types
{
[AddComponentMenu("")]
public class Type_BakeryPointLight : Type_Base
public class Type_Bakery_PointLight : Type_Base
{
[System.NonSerialized]
private BakeryPointLight type;


public SharedColor color = new SharedColor();
public SharedFloat intensity = new SharedFloat();
public SharedFloat shadowSpread = new SharedFloat();
Expand Down
11 changes: 11 additions & 0 deletions EQS_Types/Bakery/Type_Bakery_PointLight.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#if UNITY_EDITOR
#if UNITY_EDITOR && BAKERY_INCLUDED
using UnityEditor;
using UnityEngine;
using EasyQuestSwitch.Fields;

namespace EasyQuestSwitch.Types
{
[AddComponentMenu("")]
public class Type_BakerySkyLight : Type_Base
public class Type_Bakery_SkyLight : Type_Base
{
[System.NonSerialized]
private BakerySkyLight type;


public SharedColor color = new SharedColor();
public SharedFloat intensity = new SharedFloat();
public SharedInt samples = new SharedInt();
Expand Down
11 changes: 11 additions & 0 deletions EQS_Types/Bakery/Type_Bakery_SkyLight.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions EQS_Types/Type_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ namespace EasyQuestSwitch.Types
public abstract class Type_Base : MonoBehaviour
{
public abstract void Setup(Object type);

// Override without calling base to setup custom migration
public virtual void Setup(Object type, int currentVersion) => Setup(type);

public abstract void Process(Object type, BuildTarget buildTarget);
}
}
Expand Down
11 changes: 11 additions & 0 deletions EQS_Types/Type_Light.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ public override void Setup(Object type)
RenderMode.Setup(component.renderMode);
}

public override void Setup(Object type, int currentVersion)
{
Light component = (Light)type;
if (currentVersion == 0) // 0 -> 131 upgrade
{
LightType.Setup(component.type);
Range.Setup(component.range);
RenderMode.Setup(component.renderMode);
}
}

public override void Process(Object type, BuildTarget buildTarget)
{
base.Process(type, buildTarget);
Expand Down
10 changes: 10 additions & 0 deletions EQS_Types/Type_Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ public override void Setup(Object type)
GPUInstancing.Setup(material.enableInstancing);
}

public override void Setup(Object type, int currentVersion)
{
Material material = (Material)type;
if (currentVersion == 0) // 0 -> 131 upgrade
{
MainColor.Setup(material.color);
GPUInstancing.Setup(material.enableInstancing);
}
}

public override void Process(Object type, BuildTarget buildTarget)
{
Material material = (Material)type;
Expand Down
16 changes: 16 additions & 0 deletions vrchat.jordo.easyquestswitch.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "vrchat.jordo.easyquestswitch",
"rootNamespace": "",
"references": [
"GUID:a1653399f63795746b1857281d1e400d"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
7 changes: 7 additions & 0 deletions vrchat.jordo.easyquestswitch.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 011d4fb

Please sign in to comment.