SHADE_Y3/Assets/Scripts/StaticTest.cs

38 lines
725 B
C#

using SHADE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SHADE_Scripting
{
public class StaticTest
{
public static int x;
static StaticTest()
{
x = 5;
Debug.Log("Static Constructor!");
}
}
public class ImplicitStaticTest : Script
{
public static int x = 5;
static ImplicitStaticTest()
{
Debug.Log("Static Constructor!");
}
protected override void awake()
{
Debug.LogWarning($"Before Add: x = {x}");
++x;
Debug.LogWarning($"After Add: x = {x}");
}
}
}