78 lines
2.3 KiB
C#
78 lines
2.3 KiB
C#
|
using EvolutStudio.tinysAPI.BaseClasses;
|
|||
|
using EvolutStudio.VRPortfolioWork.Components;
|
|||
|
|
|||
|
namespace EvolutStudio
|
|||
|
{
|
|||
|
namespace VRPortfolioWork
|
|||
|
{
|
|||
|
namespace SimplePickupObjectDemo
|
|||
|
{
|
|||
|
public class SimplePickupObjectDemoPresenter : BaseClassPresenter
|
|||
|
{
|
|||
|
#region Public Attributes
|
|||
|
|
|||
|
// Add your public attributes
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Private Attributes
|
|||
|
|
|||
|
// Add your private attributes
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Public Functions
|
|||
|
|
|||
|
// implementation of notify
|
|||
|
override public void Notify(string notification, UnityEngine.Object DataReference = null)
|
|||
|
{
|
|||
|
if (modulInstance.Model.Validate(notification))
|
|||
|
{
|
|||
|
modulInstance.View.FireValidationSucceededEvent(notification);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
modulInstance.View.FireValidationFailedEvent(notification);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// implementation of init given component
|
|||
|
public override void InitComponent(BaseClassComponent component)
|
|||
|
{
|
|||
|
CopyValues(component);
|
|||
|
}
|
|||
|
|
|||
|
// implementation of update given component
|
|||
|
public override void UpdateComponent(BaseClassComponent component)
|
|||
|
{
|
|||
|
CopyValues(component);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Private Functions
|
|||
|
|
|||
|
// private function to copy all values from model to subview
|
|||
|
private void CopyValues(BaseClassComponent component)
|
|||
|
{
|
|||
|
if (component.GetType().Equals(typeof(SimpleTooltipComponent)))
|
|||
|
{
|
|||
|
((SimpleTooltipComponent)component).currentTooltipState = ((SimplePickupObjectDemoModel)modulInstance.Model).currentTooltipState;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Unity Events
|
|||
|
|
|||
|
// Use this for initialization
|
|||
|
void Awake()
|
|||
|
{
|
|||
|
modulInstance.RegisterPresenter(this);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|