You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
using System;
|
|
using UnityEditor.Experimental.GraphView;
|
|
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
using System.Linq;
|
|
|
|
using Object = UnityEngine.Object;
|
|
|
|
namespace UnityEditor.VFX.UI
|
|
{
|
|
class VFXBlockController : VFXNodeController
|
|
{
|
|
VFXContextController m_ContextController;
|
|
|
|
public VFXBlockController(VFXBlock model, VFXContextController contextController) : base(model, contextController.viewController)
|
|
{
|
|
m_ContextController = contextController;
|
|
if (model is VFXSubgraphBlock)
|
|
{
|
|
// Prevent breaking the editor opening.
|
|
try
|
|
{
|
|
(model as VFXSubgraphBlock).RecreateCopy();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Debug.LogException(e);
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override VFXDataAnchorController AddDataAnchor(VFXSlot slot, bool input, bool hidden)
|
|
{
|
|
if (input)
|
|
{
|
|
VFXContextDataInputAnchorController anchorController = new VFXContextDataInputAnchorController(slot, this, hidden);
|
|
|
|
return anchorController;
|
|
}
|
|
else
|
|
{
|
|
VFXContextDataOutputAnchorController anchorController = new VFXContextDataOutputAnchorController(slot, this, hidden);
|
|
|
|
return anchorController;
|
|
}
|
|
}
|
|
|
|
public VFXContextController contextController
|
|
{
|
|
get { return m_ContextController; }
|
|
}
|
|
|
|
public new VFXBlock model
|
|
{
|
|
get { return base.model as VFXBlock; }
|
|
}
|
|
|
|
public int index
|
|
{
|
|
get { return m_ContextController.FindBlockIndexOf(this); }
|
|
}
|
|
}
|
|
}
|