當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。