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


C# BaseObject类代码示例

本文整理汇总了C#中BaseObject的典型用法代码示例。如果您正苦于以下问题:C# BaseObject类的具体用法?C# BaseObject怎么用?C# BaseObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BaseObject类属于命名空间,在下文中一共展示了BaseObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ObjectAccessItem

 public ObjectAccessItem(int userID, BaseObject obj)
     : this()
 {
     this.CreatorID = userID;
     this.Users = new List<UserAccess>();
     this.Object = new LinkBaseObject(obj);
 }
开发者ID:altaricka,项目名称:vDesign,代码行数:7,代码来源:ObjectAccessItem.cs

示例2: TileWithObject

 public TileWithObject(Tile t, BaseObject baseObject, bool resize = false)
     : base(t.TexturePath, t.Rectangle)
 {
     if (baseObject == null)
         return;
     Put(baseObject, resize);
 }
开发者ID:dajuanrobins,项目名称:XNA-Game-Library,代码行数:7,代码来源:TileWithObject.cs

示例3: OnTriggerExit

    void OnTriggerExit( Collider other )
    {
        BaseObject bo = other.GetComponentInChildren<BaseObject>();

        if ( bo && bo == sensedObject )
            sensedObject = null;
    }
开发者ID:nosfex,项目名称:aztec_treasure,代码行数:7,代码来源:BaseObjectSensor.cs

示例4: CheckCollision

        public bool CheckCollision(Rectangle rectangle, out Animation outAnimation, out BaseObject outBaseObject, string id)
        {
            outAnimation = null;
            outBaseObject = null;

            foreach (var baseObject in _entities)
            {
                if(baseObject == null)
                    continue;

                if(baseObject.Id == id)
                    continue;

                var sprite = baseObject.GetComponent<Sprite>(ComponentType.Sprite);
                if(sprite == null)
                    continue;
                if (sprite.Rectangle.Intersects(rectangle))
                {
                    outAnimation = baseObject.GetComponent<Animation>(ComponentType.Animation);
                    outBaseObject = baseObject;
                    return true;
                }
            }
            return false;
        }
开发者ID:noogai03sprojects,项目名称:SpeedCodingZelda,代码行数:25,代码来源:Entities.cs

示例5: moveTo

    public void moveTo(BaseObject target)
    {
        if (_currentState == PlayerState.DEFAULT)
        {
            if (_activeTarget != null && target.pointInGraph == _activeTarget.pointInGraph)
            {
                _activeTarget.onAction();
            }
            else
            {
                _activeTarget = target;

                setState(PlayerState.MOVING);

                _navigator.startRoute(_activeTarget);
            }
        }
        else
        {
            if (_targetsStack.Count > 0)
            {
                BaseObject item = (BaseObject)_targetsStack[0];
                if(item.pointInGraph == target.pointInGraph)
                    return;
            }
            else if (_activeTarget.pointInGraph == target.pointInGraph)
            {
                return;
            }

            _targetsStack.Add(target);
        }
    }
开发者ID:DieselPuppet,项目名称:DatingDash,代码行数:33,代码来源:PlayerBehaviour.cs

示例6: Level

 public Level(ContentManager content, BaseObject player)
 {
     _entities = new List<LevelEntity>();
     _content = content;
     _player = player;
     ManagerInput.FireNewInput += ManagerInput_FireNewInput;
 }
开发者ID:Uhha,项目名称:MonoG,代码行数:7,代码来源:Level.cs

示例7: hit

 void hit(BaseObject.objectType t)
 {
     if (tx > 1)
         tx = 0;
     tx += 1f / 2;
     moveBoss();
 }
开发者ID:nolimet,项目名称:Liaka,代码行数:7,代码来源:BossTest.cs

示例8: CheckCollision

        public bool CheckCollision(Rectangle rectangle, out Animation outAnimation, out BaseObject outBaseObject, string id, bool checkOnlyHostile=false)
        {
            outAnimation = null;
            outBaseObject = null;

            foreach (var baseObject in _entities)
            {
                if(baseObject == null)
                    continue;

                if(baseObject.Id != null && baseObject.Id == id)
                    continue;

                var sprite = baseObject.GetComponent<Sprite>();
                if(sprite == null)
                    continue;
                if (sprite.Rectangle.Intersects(rectangle))
                {
                    if(checkOnlyHostile)
                        if (!baseObject.Hostile)
                            continue;
                    outAnimation = baseObject.GetComponent<Animation>();
                    outBaseObject = baseObject;
                    return true;
                }
            }
            return false;
        }
开发者ID:cquinterom,项目名称:SpeedCodingZelda,代码行数:28,代码来源:Entities.cs

示例9: LoadContent

        public override void LoadContent(ContentManager content)
        {
            _managerMap.LoadContent();

            var player = new BaseObject {Id = "player"};
            player.AddComponent(new Sprite(content.Load<Texture2D>("link_full"), 16, 16, new Vector2(50, 50)));
            player.AddComponent(new PlayerInput(ManagerScreen,_managerPlayer));
            player.AddComponent(new Animation(16, 16,2));
            player.AddComponent(new Collision(_managerMap,_entities));
            player.AddComponent(new Camera(_managerCamera));
            player.AddComponent(new Equipment(content,_managerMap,_managerCamera,_entities));
            player.GetComponent<Equipment>(ComponentType.Equipment).AddItem(new Boomerang());
            player.GetComponent<Equipment>(ComponentType.Equipment).AddItem(new Sword(_entities));
            player.GetComponent<Equipment>(ComponentType.Equipment).EquipItemInSlot(1,ItemSlot.A);
            player.GetComponent<Equipment>(ComponentType.Equipment).EquipItemInSlot(2, ItemSlot.B);
            player.AddComponent(new Damage(_entities,true));
            player.AddComponent(FactoryStats.GetStats("Link"));
            player.AddComponent(new GUI());
            player.GetComponent<GUI>(ComponentType.GUI).LoadContent(content);

            //var testNPC = new BaseObject();
            //testNPC.AddComponent(new Sprite(content.Load<Texture2D>("Marin"), 16, 16, new Vector2(50, 50)));
            //testNPC.AddComponent(new AIMovementRandom(200));
            //testNPC.AddComponent(new Animation(16, 16));
            //testNPC.AddComponent(new Collision(_managerMap));
            //testNPC.AddComponent(new Camera(_managerCamera));
            _entities.AddEntity(player);
            //for (int n = 0; n < 3; n++)
            //{
            //    var testEnemy = new BaseObject {Id = string.Format("enemy_{0}", n)};
            //    testEnemy.AddComponent(new Sprite(content.Load<Texture2D>("Octorok"), 16, 16, new Vector2(50 + ManagerFunction.Random(10,20), 50 + ManagerFunction.Random(10,20))));
            //    testEnemy.AddComponent(new AIMovementRandom(1000, 0.5f));
            //    testEnemy.AddComponent(new Animation(16, 16, 2));
            //    testEnemy.AddComponent(new Collision(_managerMap));
            //    testEnemy.AddComponent(new Octorok(player, content.Load<Texture2D>("Octorok_bullet"), _managerMap));
            //    testEnemy.AddComponent(new Camera(_managerCamera));
            //    testEnemy.AddComponent(new Damage(_entities));
            //    testEnemy.AddComponent(FactoryStats.GetStats("Octorok"));
            //    _entities.AddEntity(testEnemy);
            //}

            //_entities.AddEntity(testNPC);
            //Script test!
            //var testEnemy = new BaseObject { Id = string.Format("enemy_{0}", "script") };
            //testEnemy.AddComponent(new Sprite(content.Load<Texture2D>("Octorok"), 16, 16, new Vector2(50 + ManagerFunction.Random(10, 20), 50 + ManagerFunction.Random(10, 20))));
            //testEnemy.AddComponent(new AIMovementRandom(1000, 0.5f));
            //testEnemy.AddComponent(new Animation(16, 16, 2));
            //testEnemy.AddComponent(new Collision(_managerMap,_entities));
            //testEnemy.AddComponent(new Octorok(player, content.Load<Texture2D>("Octorok_bullet"), _managerMap,_entities));
            //testEnemy.AddComponent(new Camera(_managerCamera));
            //testEnemy.AddComponent(new Damage(_entities));
            //testEnemy.AddComponent(FactoryStats.GetStats("Octorok"));
            //testEnemy.AddComponent(new Script("script_time_test"));
            //_entities.AddEntity(testEnemy);

            //Just for test
            //var window = new WindowMessage("Hello, this is a message! This is a long message",content);
            //ManagerWindow.NewWindow("test_message",window);
        }
开发者ID:noogai03sprojects,项目名称:SpeedCodingZelda,代码行数:59,代码来源:ScreenWorld.cs

示例10: CreateObject

 private void CreateObject(Enemy enemy)
 {
     var baseObject = new BaseObject { Username = enemy.UniqueId.ToString()};
     baseObject.AddComponent(new Sprite(_texture, 32, 32, new Vector2(enemy.Position.ScreenXPosition, enemy.Position.ScreenYPosition), Color.Black, enemy.Position.Visible));
     baseObject.AddComponent(new Animation(16, 16, 2));
     //Later we add specific component for enemies here.
     _enemies.Add(baseObject);
 }
开发者ID:BTKY,项目名称:SpeedCodingNetworkGame,代码行数:8,代码来源:ManagerEnemies.cs

示例11: OctorokBullet

 public OctorokBullet(Sprite sprite, Collision collision, BaseObject player, Direction direction)
 {
     _sprite = sprite;
     _player = player;
     _direction = direction;
     _speed = 1.5f;
     _collision = collision;
 }
开发者ID:Uhha,项目名称:Zelda,代码行数:8,代码来源:OctorokBullet.cs

示例12: CreateObject

        public void CreateObject()
        {
            //Arrange
            var obj = new BaseObject();

            //Assert
            Assert.IsTrue(obj.Id != Guid.Empty);
        }
开发者ID:ErikDonato,项目名称:UncorkDRINK,代码行数:8,代码来源:BaseObjectTests.cs

示例13: Build

 public static SmsTextingException Build(BaseObject details)
 {
     String message = "";
     if (details != null && details.Errors != null)
     {
         message = details.Errors.Aggregate((current, next) => current + "; " + next);
     }
     return new SmsTextingException(message, details);
 }
开发者ID:EzTexting,项目名称:csharp-code-samples,代码行数:9,代码来源:SmsTextingException.cs

示例14: Octorok

 public Octorok(BaseObject player,Texture2D bulletTexture, ManagerMap map, int cooldown = 1000 )
 {
     _player = player;
     _bullets = new List<OctorokBullet>();
     _cooldown = cooldown;
     _counter = 0;
     _bulletTexture = bulletTexture;
     _map = map;
 }
开发者ID:Uhha,项目名称:Zelda,代码行数:9,代码来源:Octorok.cs

示例15: IsLockedFor

	public static bool IsLockedFor(string nodeName, BaseObject obj){
		SceneNode node = null;
		if (allNodes.ContainsKey(nodeName)) node =allNodes[nodeName];
		if (node != null) return (node.Locked && node.LockingObject()!=obj);
		else {
			// we could search for a game object of this name with a navNode child and add the component here...
			return false; // what to return if not found
		}
	}
开发者ID:MedStarSiTEL,项目名称:UnityTrauma,代码行数:9,代码来源:SceneNode.cs


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