本文整理汇总了C#中AC类的典型用法代码示例。如果您正苦于以下问题:C# AC类的具体用法?C# AC怎么用?C# AC使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AC类属于命名空间,在下文中一共展示了AC类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Declare
public override void Declare (AC.Char _character)
{
character = _character;
turningIsLinear = true;
rootMotion = false;
isSpriteBased = true;
}
示例2: DeleteAction
public static void DeleteAction(AC.Action action, ActionListAsset _target)
{
_target.actions.Remove (action);
Undo.DestroyObjectImmediate (action);
//UnityEngine.Object.DestroyImmediate (_action, true);
AssetDatabase.SaveAssets ();
}
示例3: magnifier_Magnify
void magnifier_Magnify(object sender, AC.AvalonControlsLibrary.Controls.MagnifyEventArgs e)
{
displayValue.Text = e.MagnifiedBy.ToString();
//as you can not depending on how much you try to magnify the speed of the magnification changes
//P.S the * 20 is there since we have a very small value for minimum and maximum
displayRect.Width = Math.Max(displayRect.Width - (e.MagnifiedBy * 20), 0);
}
示例4: Declare
public virtual void Declare (AC.Char _character)
{
character = _character;
turningIsLinear = false;
rootMotion = false;
isSpriteBased = false;
}
示例5: ClickOutput
public void ClickOutput(AC.Menu _menu, MouseState _mouseState)
{
if (items.Count > 0)
{
if (_mouseState == MouseState.SingleClick)
{
if (KickStarter.runtimeInventory.selectedItem == null)
{
// Pick up created item
if (activeRecipe.onCreateRecipe == OnCreateRecipe.SelectItem)
{
KickStarter.runtimeInventory.PerformCrafting (activeRecipe, true);
}
else if (activeRecipe.onCreateRecipe == OnCreateRecipe.RunActionList)
{
KickStarter.runtimeInventory.PerformCrafting (activeRecipe, false);
if (activeRecipe.invActionList != null)
{
AdvGame.RunActionListAsset (activeRecipe.invActionList);
}
}
else
{
KickStarter.runtimeInventory.PerformCrafting (activeRecipe, false);
}
}
}
PlayerMenus.ResetInventoryBoxes ();
}
}
示例6: SharedGUITwo
protected void SharedGUITwo(AC.Char _target)
{
EditorGUILayout.BeginVertical ("Button");
EditorGUILayout.LabelField ("Rigidbody settings:", EditorStyles.boldLabel);
_target.ignoreGravity = EditorGUILayout.Toggle ("Ignore gravity?", _target.ignoreGravity);
_target.freezeRigidbodyWhenIdle = EditorGUILayout.Toggle ("Freeze when Idle?", _target.freezeRigidbodyWhenIdle);
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
EditorGUILayout.LabelField ("Audio clips:", EditorStyles.boldLabel);
_target.walkSound = (AudioClip) EditorGUILayout.ObjectField ("Walk sound:", _target.walkSound, typeof (AudioClip), false);
_target.runSound = (AudioClip) EditorGUILayout.ObjectField ("Run sound:", _target.runSound, typeof (AudioClip), false);
if (AdvGame.GetReferences ().speechManager != null && AdvGame.GetReferences ().speechManager.scrollSubtitles)
{
_target.textScrollClip = (AudioClip) EditorGUILayout.ObjectField ("Text scroll override:", _target.textScrollClip, typeof (AudioClip), false);
}
_target.soundChild = (Sound) EditorGUILayout.ObjectField ("Sound child:", _target.soundChild, typeof (Sound), true);
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
EditorGUILayout.LabelField ("Dialogue settings:", EditorStyles.boldLabel);
EditorGUILayout.LabelField ("Portrait graphic:");
_target.portraitIcon.ShowGUI (false);
_target.speechColor = EditorGUILayout.ColorField ("Speech text colour:", _target.speechColor);
_target.speechLabel = EditorGUILayout.TextField ("Speaker label:", _target.speechLabel);
EditorGUILayout.EndVertical ();
}
示例7: QRDialog
public QRDialog(AC.Pattern pattern)
{
this.pattern = pattern;
qrImage = CreateQRCode(pattern, 3);
InitializeComponent();
}
示例8: CheckScreenSize
private void CheckScreenSize(AC.Menu menu)
{
if (screenSize.x != Screen.width || screenSize.y != Screen.height)
{
screenSize = new Vector2 (Screen.width, Screen.height);
menu.Recalculate ();
}
}
示例9: Setup
public void Setup(AC.Menu _menu, MenuElement _element, int _slot)
{
if (_menu == null)
{
return;
}
menu = _menu;
menuElement = _element;
slot = _slot;
}
示例10: RangeSlider_RangeSelectionChanged
private void RangeSlider_RangeSelectionChanged(object sender, AC.AvalonControlsLibrary.Controls.RangeSelectionChangedEventArgs e)
{
if (e.NewRangeStart > e.NewRangeStop)
{
chnSlider.RangeStartSelected = e.NewRangeStop;
chnSlider.RangeStopSelected = e.NewRangeStart;
}
if (lc != null)
{
lc.Content = chnSlider.RangeStartSelected.ToString();
hc.Content = chnSlider.RangeStopSelected.ToString();
}
}
示例11: GetPointsArray
public override Vector3[] GetPointsArray(Vector3 startPosition, Vector3 targetPosition, AC.Char _char = null)
{
NavMeshHit hit = new NavMeshHit();
NavMeshPath _path = new NavMeshPath();
if (!NavMesh.CalculatePath (startPosition, targetPosition, -1, _path))
{
// Could not find path with current vectors
float maxDistance = 0.001f;
for (maxDistance = 0.001f; maxDistance < 1f; maxDistance += 0.05f)
{
if (NavMesh.SamplePosition (startPosition, out hit, maxDistance, -1))
{
startPosition = hit.position;
break;
}
}
for (maxDistance = 0.001f; maxDistance < 1f; maxDistance += 0.05f)
{
if (NavMesh.SamplePosition (targetPosition, out hit, maxDistance, -1))
{
targetPosition = hit.position;
break;
}
}
NavMesh.CalculatePath (startPosition, targetPosition, -1, _path);
}
List<Vector3> pointArray = new List<Vector3>();
foreach (Vector3 corner in _path.corners)
{
pointArray.Add (corner);
}
if (pointArray.Count > 1 && pointArray[0].x == startPosition.x && pointArray[0].z == startPosition.z)
{
pointArray.RemoveAt (0);
}
else if (pointArray.Count == 0)
{
pointArray.Clear ();
pointArray.Add (targetPosition);
}
return (pointArray.ToArray ());
}
示例12: ChangeButton
private void ChangeButton (AC.Button button)
{
if (button == null)
{
return;
}
if (changeType == ChangeType.Enable)
{
button.isDisabled = false;
}
else if (changeType == ChangeType.Disable)
{
button.isDisabled = true;
}
}
示例13: OnMenuEnable
public static void OnMenuEnable(AC.Menu _menu)
{
// This function is called whenever a menu is enabled.
if (_menu.title == "Pause")
{
MenuElement saveButton = _menu.GetElementWithName ("SaveButton");
if (saveButton)
{
saveButton.isVisible = !PlayerMenus.IsSavingLocked ();
}
_menu.Recalculate ();
}
}
示例14: AddElement
private void AddElement(string className, AC.Menu _menu)
{
Undo.RecordObject (_menu, "Add element");
List<int> idArray = new List<int>();
foreach (MenuElement _element in _menu.elements)
{
if (_element != null)
{
idArray.Add (_element.ID);
}
}
idArray.Sort ();
className = "Menu" + className;
MenuElement newElement = (MenuElement) CreateInstance (className);
newElement.Declare ();
newElement.title = className.Substring (4);
// Update id based on array
foreach (int _id in idArray.ToArray())
{
if (newElement.ID == _id)
{
newElement.ID ++;
}
}
_menu.elements.Add (newElement);
if (!Application.isPlaying)
{
_menu.Recalculate ();
}
DeactivateAllElements (_menu);
newElement.isEditing = true;
selectedMenuElement = newElement;
newElement.hideFlags = HideFlags.HideInHierarchy;
AssetDatabase.AddObjectToAsset (newElement, this);
AssetDatabase.ImportAsset (AssetDatabase.GetAssetPath (newElement));
AssetDatabase.SaveAssets ();
CleanUpAsset ();
}
示例15: GetPointsArray
public override Vector3[] GetPointsArray(AC.Char _char, Vector3 _originPos, Vector3 _targetPos)
{
PolygonCollider2D poly = KickStarter.sceneSettings.navMesh.transform.GetComponent <PolygonCollider2D>();
bool changesMade = KickStarter.sceneSettings.navMesh.AddCharHoles (_char);
List<Vector3> pointsList3D = new List<Vector3> ();
if (IsLineClear (_originPos, _targetPos))
{
pointsList3D.Add (_targetPos);
//ResetHoles (KickStarter.sceneSettings.navMesh, changesMade);
return pointsList3D.ToArray ();
}
Vector2[] pointsList = CreateVertexArray (poly);
Vector2 originPos = GetNearestToMesh (_originPos, poly);
Vector2 targetPos = GetNearestToMesh (_targetPos, poly);
pointsList = AddEndsToList (pointsList, originPos, targetPos);
float[,] weight = pointsToWeight (pointsList);
int[] precede = buildSpanningTree (0, 1, weight);
if (precede == null)
{
Debug.LogWarning ("Pathfinding error");
pointsList3D.Add (_targetPos);
return pointsList3D.ToArray ();
}
int[] _path = getShortestPath (0, 1, precede);
foreach (int i in _path)
{
Vector3 vertex = new Vector3 (pointsList[i].x, pointsList[i].y, _originPos.z);
pointsList3D.Insert (0, vertex);
}
if (pointsList3D[0] == _originPos || (pointsList3D[0].x == originPos.x && pointsList3D[0].y == originPos.y))
{
pointsList3D.RemoveAt (0); // Remove origin point from start
}
ResetHoles (KickStarter.sceneSettings.navMesh, changesMade);
return pointsList3D.ToArray ();
}