Added player character and step in/out of dialogue in scene 101
This commit is contained in:
+66
@@ -0,0 +1,66 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.ProBuilder;
|
||||
using UnityEngine.ProBuilder.MeshOperations;
|
||||
|
||||
namespace UnityEditor.ProBuilder.Actions
|
||||
{
|
||||
sealed class SelectFaceLoop : MenuAction
|
||||
{
|
||||
public override ToolbarGroup group
|
||||
{
|
||||
get { return ToolbarGroup.Selection; }
|
||||
}
|
||||
|
||||
public override string iconPath => "Toolbar/Selection_Loop_Face";
|
||||
public override Texture2D icon => IconUtility.GetIcon(iconPath);
|
||||
|
||||
public override TooltipContent tooltip
|
||||
{
|
||||
get { return s_Tooltip; }
|
||||
}
|
||||
|
||||
public override int toolbarPriority
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
protected internal override bool hasFileMenuEntry
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
private static readonly TooltipContent s_Tooltip = new TooltipContent
|
||||
(
|
||||
"Select Face Loop",
|
||||
"Selects a loop of connected faces.\n\n<b>Shortcut</b>: Shift + Double Click on Face."
|
||||
);
|
||||
|
||||
public override SelectMode validSelectModes
|
||||
{
|
||||
get { return SelectMode.Face | SelectMode.TextureFace; }
|
||||
}
|
||||
|
||||
public override bool enabled
|
||||
{
|
||||
get { return base.enabled && MeshSelection.selectedFaceCount > 0; }
|
||||
}
|
||||
|
||||
protected override ActionResult PerformActionImplementation()
|
||||
{
|
||||
var selection = MeshSelection.topInternal;
|
||||
|
||||
UndoUtility.RecordSelection("Select Face Loop");
|
||||
|
||||
foreach (ProBuilderMesh pb in selection)
|
||||
{
|
||||
HashSet<Face> loop = ElementSelection.GetFaceLoop(pb, pb.selectedFacesInternal);
|
||||
pb.SetSelectedFaces(loop);
|
||||
}
|
||||
|
||||
ProBuilderEditor.Refresh();
|
||||
|
||||
return new ActionResult(ActionResult.Status.Success, "Select Face Loop");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user