83 lines
2.8 KiB
C#
83 lines
2.8 KiB
C#
using EvolutStudio.tinysAPI.BaseClasses;
|
|
using EvolutStudio.VRPortfolioWork.Components;
|
|
|
|
namespace EvolutStudio
|
|
{
|
|
namespace VRPortfolioWork
|
|
{
|
|
namespace ConfiguratorDemo
|
|
{
|
|
public class VarnishChoosingPanelPresenter : 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, DataReference))
|
|
{
|
|
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(ConsoleTooltipComponent)))
|
|
{
|
|
((ConsoleTooltipComponent)component).currentTooltipState = ((VarnishChoosingPanelModel)modulInstance.Model).currentTooltipState;
|
|
((ConsoleTooltipComponent)component).currentTooltipText = ((VarnishChoosingPanelModel)modulInstance.Model).currentTooltipText;
|
|
}
|
|
else if (component.GetType().Equals(typeof(VarnishMaterialChangeComponent)))
|
|
{
|
|
((VarnishMaterialChangeComponent)component).selectedMaterial = ((VarnishChoosingPanelModel)modulInstance.Model).selectedMaterial;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Unity Events
|
|
|
|
// Use this for initialization
|
|
void Awake()
|
|
{
|
|
modulInstance.RegisterPresenter(this);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|
|
}
|
|
} |