本文整理汇总了C#中Sim.AddScriptEventHandler方法的典型用法代码示例。如果您正苦于以下问题:C# Sim.AddScriptEventHandler方法的具体用法?C# Sim.AddScriptEventHandler怎么用?C# Sim.AddScriptEventHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sim
的用法示例。
在下文中一共展示了Sim.AddScriptEventHandler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SitDown
public static bool SitDown(HotTubBase ths, Sim s, Slot slot, HotTubSeat seat, Sim.SwitchOutfitHelper switchOutfitHelper, bool isSkinnyDipping, Sim invitedBy, bool isAutonomous)
{
bool flag = isSkinnyDipping;
bool paramValue = true;
if ((s.GetCurrentOutfitCategoryFromOutfitInGameObject() == OutfitCategories.Swimwear) && !isSkinnyDipping)
{
paramValue = false;
}
if ((s.OccultManager.DisallowClothesChange() || (s.GetCurrentOutfitCategoryFromOutfitInGameObject() == OutfitCategories.Singed)) || s.BuffManager.DisallowClothesChange())
{
paramValue = false;
}
if ((s.Service != null) && (s.Service.ServiceType == ServiceType.GrimReaper))
{
paramValue = false;
}
if (s.GetCurrentOutfitCategoryFromOutfitInGameObject() == OutfitCategories.Naked)
{
flag = false;
}
else
{
s.RefreshCurrentOutfit(false);
}
if (!paramValue)
{
flag = false;
}
ths.PartComponent.SetSimAtPart(s, slot);
switchOutfitHelper.Wait(true);
StateMachineClient smc = StateMachineClient.Acquire(s, "HotTub", AnimationPriority.kAPDefault);
if (smc == null)
{
s.AddExitReason(ExitReason.NullValueFound);
ths.PartComponent.SetSimAtPart(null, slot);
switchOutfitHelper.Dispose();
return false;
}
smc.SetActor("x", s);
smc.SetActor("hotTub", ths);
smc.SetParameter("IkSuffix", seat.IKSuffix);
smc.SetParameter("isMirrored", seat.IsMirrored);
smc.SetParameter("doClothesSpin", paramValue);
smc.SetParameter("playLookaround", isSkinnyDipping && ths.IsFirstSkinnyDipper());
smc.AddOneShotScriptEventHandler(0x67, new SacsEventHandler(ths.TubEntered));
smc.AddOneShotScriptEventHandler(0xc9, new SacsEventHandler(seat.SlotSimIntoHottub));
smc.AddPersistentScriptEventHandler(0x69, new SacsEventHandler(seat.UnparentAndUpdateDrinkStatus));
if (flag)
{
smc.AddOneShotScriptEventHandler(0x67, new SacsEventHandler(seat.CreateClothingPile));
}
smc.EnterState("x", "Enter");
switchOutfitHelper.AddScriptEventHandler(smc);
Glass actor = null;
seat.DrinkRef = null;
Glass.CarryingGlassPosture posture = s.Posture as Glass.CarryingGlassPosture;
if (posture != null)
{
actor = posture.ObjectBeingCarried as Glass;
CarrySystem.ExitCarry(s);
actor.FadeOut(true);
actor.UnParent();
s.PopPosture();
actor.ParentToSlot(ths, seat.DrinkSlot);
actor.FadeIn();
smc.SetActor("drink", actor);
seat.DrinkRef = actor;
}
s.InteractionQueue.CancelAllInteractionsByType(Glass.Drink.Singleton);
StereoCheap cheap = s.Inventory.Find<StereoCheap>();
if (((cheap != null) && !ths.IsSlotOccupied(ths.BoomboxSlot)) && s.Inventory.TryToRemove(cheap))
{
cheap.SetOpacity(0f, 0f);
if (cheap.ParentToSlot(ths, ths.BoomboxSlot))
{
cheap.FadeIn(false);
}
else
{
cheap.FadeIn(false, 0f);
s.Inventory.TryToAdd(cheap);
}
}
smc.SetParameter("hasDrink", actor != null);
smc.RequestState("x", "Sitting");
HotTubPosture posture2 = new HotTubPosture(s, ths, smc, seat);
posture2.InvitedBy = invitedBy;
posture2.AutonomouslyChosen = isAutonomous;
s.Posture = posture2;
if (!s.Posture.Satisfies(CommodityKind.InHotTub, ths))
{
//.........这里部分代码省略.........