本文整理汇总了C#中AC.ActionListAsset类的典型用法代码示例。如果您正苦于以下问题:C# ActionListAsset类的具体用法?C# ActionListAsset怎么用?C# ActionListAsset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionListAsset类属于AC命名空间,在下文中一共展示了ActionListAsset类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAction
public static void AddAction(string className, int i, ActionListAsset _target)
{
List<int> idArray = new List<int>();
foreach (AC.Action _action in _target.actions)
{
idArray.Add (_action.id);
}
idArray.Sort ();
AC.Action newAction = (AC.Action) CreateInstance (className);
newAction.hideFlags = HideFlags.HideInHierarchy;
// Update id based on array
foreach (int _id in idArray.ToArray())
{
if (newAction.id == _id)
newAction.id ++;
}
newAction.name = newAction.title;
_target.actions.Insert (i, newAction);
AssetDatabase.AddObjectToAsset (newAction, _target);
AssetDatabase.ImportAsset (AssetDatabase.GetAssetPath (newAction));
AssetDatabase.Refresh ();
}
示例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: RunActionListAsset
public static RuntimeActionList RunActionListAsset (ActionListAsset actionListAsset, Conversation endConversation, int i)
{
if (actionListAsset != null && actionListAsset.actions.Count > 0)
{
GameObject runtimeActionListObject = (GameObject) Instantiate (Resources.Load (Resource.runtimeActionList));
RuntimeActionList runtimeActionList = runtimeActionListObject.GetComponent <RuntimeActionList>();
runtimeActionList.DownloadActions (actionListAsset, endConversation, i);
return runtimeActionList;
}
return null;
}
示例4: DownloadActions
/**
* <summary>Downloads and runs the settings and Actions stored within an ActionListAsset.</summary>
* <param name = "actionListAsset">The ActionListAsset to copy Actions from and run</param>
* <param name = "endConversation">If set, the supplied Conversation will be run when the AcionList ends</param>
* <param name = "i">The index number of the first Action to run</param>
* <param name = "doSkip">If True, then the Actions will be skipped, instead of run normally</param>
* <param name = "addToSkipQueue">If True, the ActionList will be skippable when the user presses 'EndCutscene'</param>
*/
public void DownloadActions(ActionListAsset actionListAsset, Conversation endConversation, int i, bool doSkip, bool addToSkipQueue)
{
this.name = actionListAsset.name;
assetSource = actionListAsset;
useParameters = actionListAsset.useParameters;
parameters = actionListAsset.parameters;
unfreezePauseMenus = actionListAsset.unfreezePauseMenus;
actionListType = actionListAsset.actionListType;
if (actionListAsset.actionListType == ActionListType.PauseGameplay)
{
isSkippable = actionListAsset.isSkippable;
}
else
{
isSkippable = false;
}
conversation = endConversation;
actions.Clear ();
foreach (AC.Action action in actionListAsset.actions)
{
ActionEnd _lastResult = action.lastResult;
actions.Add (action);
if (doSkip && action != null)
{
actions[actions.Count-1].lastResult = _lastResult;
}
}
if (!useParameters)
{
foreach (Action action in actions)
{
action.AssignValues (null);
}
}
if (doSkip)
{
Skip (i);
}
else
{
Interact (i, addToSkipQueue);
}
}
示例5: DestroyAssetList
public void DestroyAssetList(ActionListAsset asset)
{
RuntimeActionList[] runtimeActionLists = FindObjectsOfType (typeof (RuntimeActionList)) as RuntimeActionList[];
foreach (RuntimeActionList runtimeActionList in runtimeActionLists)
{
if (runtimeActionList.assetSource == asset)
{
if (activeLists.Contains (runtimeActionList))
{
activeLists.Remove (runtimeActionList);
}
Destroy (runtimeActionList.gameObject);
}
}
}
示例6: AssetGUI
public static ActionListAsset AssetGUI(string label, ActionListAsset actionListAsset)
{
EditorGUILayout.BeginHorizontal ();
actionListAsset = (ActionListAsset) EditorGUILayout.ObjectField (label, actionListAsset, typeof (ActionListAsset), false);
if (actionListAsset == null)
{
if (GUILayout.Button ("Create", GUILayout.MaxWidth (60f)))
{
actionListAsset = ActionListAssetMenu.CreateAsset ();
}
}
EditorGUILayout.EndHorizontal ();
return actionListAsset;
}
示例7: CopyFromAsset
public void CopyFromAsset(ActionListAsset actionListAsset)
{
isSkippable = actionListAsset.isSkippable;
actionListType = actionListAsset.actionListType;
useParameters = actionListAsset.useParameters;
// Copy parameters
parameters = new List<ActionParameter>();
parameters.Clear ();
foreach (ActionParameter parameter in actionListAsset.parameters)
{
parameters.Add (new ActionParameter (parameter));
}
// Actions
actions = new List<Action>();
actions.Clear ();
Vector2 firstPosition = new Vector2 (14f, 14f);
foreach (Action originalAction in actionListAsset.actions)
{
if (originalAction == null)
{
continue;
}
AC.Action duplicatedAction = Object.Instantiate (originalAction) as AC.Action;
if (actionListAsset.actions.IndexOf (originalAction) == 0)
{
duplicatedAction.nodeRect.x = firstPosition.x;
duplicatedAction.nodeRect.y = firstPosition.y;
}
else
{
duplicatedAction.nodeRect.x = firstPosition.x + (originalAction.nodeRect.x - firstPosition.x);
duplicatedAction.nodeRect.y = firstPosition.y + (originalAction.nodeRect.y - firstPosition.y);
}
duplicatedAction.isMarked = false;
duplicatedAction.isAssetFile = false;
actions.Add (duplicatedAction);
}
}
示例8: CopyButton
public void CopyButton(MenuButton _element)
{
uiButton = _element.uiButton;
uiText = _element.uiText;
label = _element.label;
hotspotLabel = _element.hotspotLabel;
hotspotLabelID = _element.hotspotLabelID;
anchor = _element.anchor;
textEffects = _element.textEffects;
buttonClickType = _element.buttonClickType;
simulateInput = _element.simulateInput;
simulateValue = _element.simulateValue;
doFade = _element.doFade;
switchMenuTitle = _element.switchMenuTitle;
inventoryBoxTitle = _element.inventoryBoxTitle;
shiftInventory = _element.shiftInventory;
loopJournal = _element.loopJournal;
actionList = _element.actionList;
inputAxis = _element.inputAxis;
clickTexture = _element.clickTexture;
clickAlpha = _element.clickAlpha;
shiftAmount = _element.shiftAmount;
onlyShowWhenEffective = _element.onlyShowWhenEffective;
allowContinuousClick = _element.allowContinuousClick;
parameterID = _element.parameterID;
parameterValue = _element.parameterValue;
base.Copy (_element);
}
示例9: ActionListEditorWindowData
public ActionListEditorWindowData()
{
isLocked = false;
targetID = 0;
_target = null;
targetAsset = null;
}
示例10: Declare
public override void Declare ()
{
label = "Button";
hotspotLabel = "";
hotspotLabelID = -1;
isVisible = true;
isClickable = true;
textEffects = TextEffects.None;
buttonClickType = AC_ButtonClickType.RunActionList;
simulateInput = SimulateInputType.Button;
simulateValue = 1f;
numSlots = 1;
anchor = TextAnchor.MiddleCenter;
SetSize (new Vector2 (10f, 5f));
doFade = false;
switchMenuTitle = "";
inventoryBoxTitle = "";
shiftInventory = AC_ShiftInventory.ShiftLeft;
loopJournal = false;
actionList = null;
inputAxis = "";
clickTexture = null;
clickAlpha = 0f;
shiftAmount = 1;
onlyShowWhenEffective = false;
allowContinuousClick = false;
base.Declare ();
}
示例11: ActionEnd
/**
* <summary>A Constructor that copies the values of another ActionEnd.</summary>
* <param name = "_actionEnd">The ActionEnd to copy from</param>
*/
public ActionEnd(ActionEnd _actionEnd)
{
resultAction = _actionEnd.resultAction;
skipAction = _actionEnd.skipAction;
skipActionActual = _actionEnd.skipActionActual;
linkedCutscene = _actionEnd.linkedCutscene;
linkedAsset = _actionEnd.linkedAsset;
}
示例12: CopyProfilesList
public void CopyProfilesList(MenuProfilesList _element)
{
uiSlots = _element.uiSlots;
textEffects = _element.textEffects;
anchor = _element.anchor;
maxSlots = _element.maxSlots;
actionListOnClick = _element.actionListOnClick;
showActive = _element.showActive;
base.Copy (_element);
}
示例13: CopyButton
public void CopyButton (Button _button)
{
interaction = _button.interaction;
assetFile = _button.assetFile;
customScriptObject = _button.customScriptObject;
customScriptFunction = _button.customScriptFunction;
isDisabled = _button.isDisabled;
invID = _button.invID;
iconID = _button.iconID;
playerAction = _button.playerAction;
setProximity = _button.setProximity;
proximity = _button.proximity;
faceAfter = _button.faceAfter;
isBlocking = _button.isBlocking;
}
示例14: CopySavesList
public void CopySavesList (MenuSavesList _element)
{
newSaveText = _element.newSaveText;
textEffects = _element.textEffects;
anchor = _element.anchor;
saveListType = _element.saveListType;
maxSaves = _element.maxSaves;
actionListOnSave = _element.actionListOnSave;
displayType = _element.displayType;
blankSlotTexture = _element.blankSlotTexture;
fixedOption = _element.fixedOption;
optionToShow = _element.optionToShow;
base.Copy (_element);
}
示例15: SkipList
/**
* <summary>A Constructor that assigns the variables explicitly.</summary>
* <param name = "_actionList">The ActionList this references. If it is a RuntimeActionList, its assetSource will be assigned to actionListAsset.</param>
* <param name = "_startIndex">The index number of the Action to skip from</param>
*/
public SkipList(ActionList _actionList, int _startIndex)
{
actionList = _actionList;
startIndex = _startIndex;
if (_actionList is RuntimeActionList)
{
RuntimeActionList runtimeActionList = (RuntimeActionList) _actionList;
actionListAsset = runtimeActionList.assetSource;
}
else
{
actionListAsset = null;
}
}