コード例 #1
0
    sealed public override bool IsAttatchable()
    {
        InputDefinitionOfBlockEditorUnit topInputDefinitionOfBlockEditorUnit = UiUtility.GetTopBlockEditorElementWithWorldPoint <InputDefinitionOfBlockEditorUnit>(transform.position, InputDefinitionOfBlockEditorUnit.InputDefinitionOfBlockEditorUnitTag, x => x.GetType() == this.TargetEditorBlockType);

        //Debug.Log("topInputSpaceElementOfBlockUnit " + topInputSpaceElementOfBlockUnit?.OwnerBlockEditorUnit?.name);
        if (topInputDefinitionOfBlockEditorUnit == null || topInputDefinitionOfBlockEditorUnit.OwnerBlockEditorUnit == this || topInputDefinitionOfBlockEditorUnit.OwnerBlockEditorUnit._BlockEditorUnitFlag.HasFlag(BlockEditorUnitFlag.IsAttachable) == false || topInputDefinitionOfBlockEditorUnit.IsEmpty == false)
        {
            base.AttachableEditorElement = null;
            return(false);
        }
        else
        {
            base.AttachableEditorElement = topInputDefinitionOfBlockEditorUnit;
            return(true);
        }
    }
コード例 #2
0
 /// <summary>
 /// Gets the top flow block connector.
 /// </summary>
 /// <returns>The top flow block connector.</returns>
 /// <param name="worldPoint">World position.</param>
 /// <param name="exceptedUnitList">Excepted unit list.</param>
 /// <param name="expectedConnectorType">Expected connector type. if this value is 2 , UpNotch, DownBump is ok</param>
 private FlowBlockConnector GetTopFlowBlockConnector(Vector2 worldPoint, FlowBlockConnector.ConnectorType expectedConnectorTypeFlag)
 {
     return(UiUtility.GetTopBlockEditorElementWithWorldPoint <FlowBlockConnector>(worldPoint, FlowBlockConnector.FlowBlockConnectorTag, x => expectedConnectorTypeFlag.HasFlag(x._ConnectorType) == true));
 }