本文整理汇总了C#中SimDescription.PushAgingEnabledToAgingManager方法的典型用法代码示例。如果您正苦于以下问题:C# SimDescription.PushAgingEnabledToAgingManager方法的具体用法?C# SimDescription.PushAgingEnabledToAgingManager怎么用?C# SimDescription.PushAgingEnabledToAgingManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimDescription
的用法示例。
在下文中一共展示了SimDescription.PushAgingEnabledToAgingManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImportSim
public static bool ImportSim(SimDescription desc, Vector3 simPos, ulong inventoryIndex)
{
if (desc.Weight < 0f)
{
desc.ChangeBodyShape(0f, desc.Fitness, -desc.Weight);
}
else
{
desc.ChangeBodyShape(desc.Weight, desc.Fitness, 0f);
}
desc.PushAgingEnabledToAgingManager();
Sim createdSim = desc.CreatedSim;
if (createdSim == null)
{
createdSim = Instantiation.Perform(desc, simPos, null, null);
if (createdSim == null)
{
FixInvisibleTask.Perform(desc, false);
createdSim = Instantiation.Perform(desc, simPos, null, null);
if (createdSim == null) return false;
}
}
try
{
Bin.ImportInventory(inventoryIndex, createdSim.Inventory);
createdSim.GrantSpecialObjects(false, false);
}
catch (Exception e)
{
Common.Exception(createdSim, e);
}
return true;
}
示例2: Perform
// From SimDescription.Instantiate
private static Sim Perform(SimDescription ths, Vector3 position, ResourceKey outfitKey, bool forceAlwaysAnimate, OnReset reset)
{
Household.HouseholdSimsChangedCallback changedCallback = null;
Household changedHousehold = null;
bool isChangingWorlds = GameStates.sIsChangingWorlds;
bool isLifeEventManagerEnabled = LifeEventManager.sIsLifeEventManagerEnabled;
Corrections.RemoveFreeStuffAlarm(ths);
using (SafeStore store = new SafeStore(ths, SafeStore.Flag.LoadFixup | SafeStore.Flag.Selectable | SafeStore.Flag.Unselectable))
{
try
{
// Stops the memories system from interfering
LifeEventManager.sIsLifeEventManagerEnabled = false;
// Stops UpdateInformationKnownAboutRelationships()
GameStates.sIsChangingWorlds = true;
if (ths.Household != null)
{
changedCallback = ths.Household.HouseholdSimsChanged;
changedHousehold = ths.Household;
ths.Household.HouseholdSimsChanged = null;
}
if (ths.CreatedSim != null)
{
AttemptToPutInSafeLocation(ths.CreatedSim, false);
if (reset != null)
{
ths.CreatedSim.SetObjectToReset();
reset(ths.CreatedSim, false);
}
return ths.CreatedSim;
}
if (ths.AgingState != null)
{
bool flag = outfitKey == ths.mDefaultOutfitKey;
ths.AgingState.SimBuilderTaskDeferred = false;
ths.AgingState.PreInstantiateSim(ref outfitKey);
if (flag)
{
ths.mDefaultOutfitKey = outfitKey;
}
}
int capacity = forceAlwaysAnimate ? 0x4 : 0x2;
Hashtable overrides = new Hashtable(capacity);
overrides["simOutfitKey"] = outfitKey;
overrides["rigKey"] = CASUtils.GetRigKeyForAgeGenderSpecies((ths.Age | ths.Gender) | ths.Species);
if (forceAlwaysAnimate)
{
overrides["enableSimPoseProcessing"] = 0x1;
overrides["animationRunsInRealtime"] = 0x1;
}
string instanceName = "GameSim";
ProductVersion version = ProductVersion.BaseGame;
if (ths.Species != CASAgeGenderFlags.Human)
{
instanceName = "Game" + ths.Species;
version = ProductVersion.EP5;
}
SimInitParameters initData = new SimInitParameters(ths);
Sim target = GlobalFunctions.CreateObjectWithOverrides(instanceName, version, position, 0x0, Vector3.UnitZ, overrides, initData) as Sim;
if (target != null)
{
if (target.SimRoutingComponent == null)
{
// Performed to ensure that a useful error message is produced when the Sim construction fails
target.OnCreation();
target.OnStartup();
}
target.SimRoutingComponent.EnableDynamicFootprint();
target.SimRoutingComponent.ForceUpdateDynamicFootprint();
ths.PushAgingEnabledToAgingManager();
/* This code is idiotic
if ((ths.Teen) && (target.SkillManager != null))
{
Skill skill = target.SkillManager.AddElement(SkillNames.Homework);
while (skill.SkillLevel < SimDescription.kTeenHomeworkSkillStartLevel)
{
skill.ForceGainPointsForLevelUp();
}
}
//.........这里部分代码省略.........
示例3: SimToPlayableGhost
public static Urnstone SimToPlayableGhost(SimDescription me, SimDescription.DeathType deathType)
{
Urnstone urnstone = FindGhostsGrave(me);
if (urnstone == null)
{
urnstone = PrivateCreateGrave(me);
if (urnstone == null)
{
return null;
}
}
if (!Inventories.TryToMove(urnstone, me.CreatedSim))
{
MoveToMausoleum(urnstone);
}
me.IsGhost = true;
me.SetDeathStyle(deathType, true);
if (me.CreatedSim != null)
{
urnstone.GhostSetup(me.CreatedSim, true);
if (!me.IsEP11Bot)
{
me.AgingEnabled = true;
me.PushAgingEnabledToAgingManager();
}
}
return urnstone;
}