本文整理汇总了C#中GameObject.RemoveInteractionByType方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.RemoveInteractionByType方法的具体用法?C# GameObject.RemoveInteractionByType怎么用?C# GameObject.RemoveInteractionByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObject
的用法示例。
在下文中一共展示了GameObject.RemoveInteractionByType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveMoveInteractions
public static void RemoveMoveInteractions(GameObject gameObject, bool resetLocation)
{
if (MovedObjects.ContainsKey(gameObject))
{
if (resetLocation)
{
LocationVectors vectors;
if (MovedObjects.TryGetValue(gameObject, out vectors))
{
gameObject.SetForward(vectors.ForwardVector);
gameObject.SetPosition(vectors.Position);
}
}
MovedObjects.Remove(gameObject);
}
gameObject.RemoveInteractionByType(StopMovingMe.Singleton);
gameObject.RemoveInteractionByType(TurnLeft.Singleton);
gameObject.RemoveInteractionByType(TurnAtAngle.Singleton);
gameObject.RemoveInteractionByType(TurnRight.Singleton);
gameObject.RemoveInteractionByType(TurnAround.Singleton);
gameObject.RemoveInteractionByType(TiltFaceUp.Singleton);
gameObject.RemoveInteractionByType(TiltBack.Singleton);
gameObject.RemoveInteractionByType(TiltForward.Singleton);
gameObject.RemoveInteractionByType(TiltFaceDown.Singleton);
gameObject.RemoveInteractionByType(TiltUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveUp.Singleton);
gameObject.RemoveInteractionByType(MoveUpUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveDown.Singleton);
gameObject.RemoveInteractionByType(MoveDownUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveBack.Singleton);
gameObject.RemoveInteractionByType(MoveBackUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveForward.Singleton);
gameObject.RemoveInteractionByType(MoveForwardUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveRight.Singleton);
gameObject.RemoveInteractionByType(MoveRightUserDefined.Singleton);
gameObject.RemoveInteractionByType(MoveLeft.Singleton);
gameObject.RemoveInteractionByType(MoveLeftUserDefined.Singleton);
}
示例2: InitInteractions
public static void InitInteractions(GameObject obj)
{
ServingContainer container = obj as ServingContainer;
if (container != null)
{
// EA fail
container.RemoveInteractionByType(ServingContainerGroup.CallToMeal.Singleton);
}
WeddingCake cake = obj as WeddingCake;
if (cake != null)
{
cake.RemoveInteractionByType(WeddingCake.CutWeddingCake.Singleton);
}
Snack container2 = obj as Snack;
if (container2 != null)
{
if (obj != null)
{
obj.RemoveInteractionByType(CraftersConsignment.ChildObjectBrowseStub.Singleton);
obj.RemoveInteractionByType(CraftersConsignment.ChildObjectPurchaseStub.Singleton);
obj.AddInteraction(CraftersConsignment.ChildObjectBrowseStub.Singleton);
obj.AddInteraction(CraftersConsignment.ChildObjectPurchaseStub.Singleton);
obj.RemoveInteractionByType(Sims3.Gameplay.Objects.CookingObjects.Eat.Singleton);
obj.RemoveInteractionByType(Snack_CleanUp.Singleton);
}
ISpoilable spoil = container2 as ISpoilable;
if (spoil != null)
{
spoil.UpdateSpoilageTime(true, -1f);
}
}
}
示例3: AddInteractions
public static void AddInteractions(GameObject obj)
{
//Grill grill = obj as Grill;
//Stove stove = obj as Stove;
//Fridge fridge = obj as Fridge;
//Microwave micro = obj as Microwave;
//FoodProcessor processor = obj as FoodProcessor;
if (obj != null && obj.Interactions != null)
{
if (obj is Fridge) //(fridge != null)
{
//InteractionObjectPair i2 = new InteractionObjectPair(OverridedFridge_Have.Singleton, obj);
//if (!obj.Interactions.Contains(i2))
// {
obj.RemoveInteractionByType(typeof(Fridge_Have.Definition));
obj.RemoveInteractionByType (typeof(Fridge_Prepare.PrepareDefinition));
// obj.Interactions.RemoveAt(0);
obj.AddInteraction(OverridedFridge_Have.Singleton, true);
obj.AddInteraction(OverridedFridge_Prepare.PrepareSingleton, true);
//}
}
else if (obj is Microwave)//(micro != null)
{
//InteractionObjectPair i2 = new InteractionObjectPair(OverridedMicrowave_Have.Singleton, obj);
//if (!obj.Interactions.Contains(i2))
//{
obj.RemoveInteractionByType (typeof(Microwave_Have.Definition));
obj.AddInteraction(OverridedMicrowave_Have.Singleton, true);
//}
}
else if (obj is FoodProcessor)//(processor != null)
{
//InteractionObjectPair i2 = new InteractionObjectPair(OverridedFoodProcessor_Have.Singleton, obj);
//if (!obj.Interactions.Contains(i2))
//{
obj.RemoveInteractionByType (typeof(FoodProcessor.FoodProcessor_Have.Definition));
obj.AddInteraction(OverridedFoodProcessor_Have.Singleton, true);
//}
}
else if (obj is Stove)//(stove != null)
{
//InteractionObjectPair i2 = new InteractionObjectPair(OverridedStove_Have.Singleton, obj);
//if (!obj.Interactions.Contains(i2))
//{
obj.RemoveInteractionByType (typeof(Stove_Have.Definition));
obj.AddInteraction(OverridedStove_Have.Singleton, true);
//}
}
else if (obj is Grill)//(grill != null)
{
//InteractionObjectPair i2 = new InteractionObjectPair(OverridedGrill_Have.Singleton, obj);
//if (!obj.Interactions.Contains(i2))
//{
obj.RemoveInteractionByType (typeof(Grill_Have.Definition));
obj.AddInteraction(OverridedGrill_Have.Singleton, true);
//}
}
}
}