Restore the stable legacy Unity project

This commit is contained in:
Meta Vens 2026-08-10 14:57:50 +01:00
commit 7006a6b0dd
2070 changed files with 180490 additions and 169303 deletions

View file

@ -1,18 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;
[Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn), Order(-25)]
public class SwitchData : BehaviorData
{
public override Behavior CreateInstance(EquippedItem item)
{
return new Switch(this, item);
}
public override Behavior CreateInstance(ConsumableItemEffect item)
{
return new Switch(this, item);
}
}
public class Switch : Behavior, IActivatedBehavior
{
private SwitchData _data;
public bool Activated { get; set; }
public Switch(RuntimeBehaviorDefinition definition, EquippedItem item) : base(definition, item)
public Switch(SwitchData data, EquippedItem item) : base(data, item)
{
_data = data;
}
public Switch(RuntimeBehaviorDefinition definition, ConsumableItemEffect item) : base(definition, item)
public Switch(SwitchData data, ConsumableItemEffect item) : base(data, item)
{
_data = data;
}
public override bool Execute(float dt)
@ -29,4 +49,4 @@ public class Switch : Behavior, IActivatedBehavior
{
Activated = false;
}
}
}