using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")]
[assembly: AssemblyCompany("RepoXmasMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RepoXmasMod")]
[assembly: AssemblyTitle("RepoXmasMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
[BepInPlugin("com.yourname.repo.xmasmod", "R.E.P.O Xmas Mod", "1.0.0")]
public class XmasMod : BaseUnityPlugin
{
private GameObject christmasTree;
private GameObject[] christmasLights;
private void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
Camera.main.backgroundColor = Color.red;
((BaseUnityPlugin)this).Logger.LogInfo((object)"Xmas Mod Loaded!");
AddChristmasDecorations();
}
private void AddChristmasDecorations()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Expected O, but got Unknown
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
christmasTree = GameObject.CreatePrimitive((PrimitiveType)2);
christmasTree.transform.localScale = new Vector3(2f, 5f, 2f);
christmasTree.transform.position = new Vector3(0f, 2.5f, 0f);
christmasTree.GetComponent<Renderer>().material.color = Color.green;
int num = 10;
christmasLights = (GameObject[])(object)new GameObject[num];
for (int i = 0; i < num; i++)
{
GameObject val = new GameObject("ChristmasLight" + i);
val.transform.parent = christmasTree.transform;
val.transform.position = new Vector3(Random.Range(-1f, 1f), Random.Range(1f, 4.5f), Random.Range(-1f, 1f));
Light val2 = val.AddComponent<Light>();
val2.type = (LightType)2;
val2.color = Random.ColorHSV();
val2.intensity = 2f;
val2.range = 3f;
val.AddComponent<BlinkingLight>();
christmasLights[i] = val;
}
}
}
public class BlinkingLight : MonoBehaviour
{
private Light light;
private float timer;
private void Start()
{
light = ((Component)this).GetComponent<Light>();
}
private void Update()
{
timer += Time.deltaTime;
if (timer > Random.Range(0.2f, 0.6f))
{
((Behaviour)light).enabled = !((Behaviour)light).enabled;
timer = 0f;
}
}
}