// Copyright (c) 2015 - 2023 Doozy Entertainment. All Rights Reserved.
// This code can only be used under the standard Unity Asset Store End User License Agreement
// A Copy of the EULA APPENDIX 1 is available at http://unity3d.com/company/legal/as_terms
using UnityEngine;
namespace Doozy.Runtime.Common.Events
{
/// Base class used to keep track of value changes
/// Any type
public abstract class ValueChangedEventBase : IValueChangedEvent
{
/// Previous value
public T previousValue { get; }
/// New value
public T newValue { get; }
/// Animate change flag
public bool animateChange { get; }
/// Flag to mark the event used
public bool used { get; set; }
/// Event timestamp
public float timestamp { get; }
/// Construct a value changed event
/// Previous value
/// New value
/// Animate change flag
protected ValueChangedEventBase(T previousValue, T newValue, bool animateChange)
{
this.previousValue = previousValue;
this.newValue = newValue;
this.animateChange = animateChange;
used = false;
timestamp = Time.time;
}
}
}