You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Feel/MMTools/Demos/MMObservable/MMObservableDemoSubject.cs

23 lines
610 B
C#

2 months ago
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// A test class used to demonstrate how MMObservable works in the MMObservableTest demo scene
/// </summary>
public class MMObservableDemoSubject : MonoBehaviour
{
/// a public float we expose, outputting the x position of our object
public MMObservable<float> PositionX = new MMObservable<float>();
/// <summary>
/// On Update we update our x position
/// </summary>
protected virtual void Update()
{
PositionX.Value = this.transform.position.x;
}
}
}