当前位置: 首页>>代码示例>>C#>>正文


C# GameObject.RemoveInteractionByType方法代码示例

本文整理汇总了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);
        }
开发者ID:markmanching,项目名称:virtual-artisan-s3mods,代码行数:41,代码来源:PoseManager.cs

示例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);
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:36,代码来源:BakeryController.cs

示例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);
                    //}
                }

            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:63,代码来源:AddMenuItem.cs


注:本文中的GameObject.RemoveInteractionByType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。