當前位置: 首頁>>代碼示例>>C#>>正文


C# GameState.addGameObject方法代碼示例

本文整理匯總了C#中GameState.addGameObject方法的典型用法代碼示例。如果您正苦於以下問題:C# GameState.addGameObject方法的具體用法?C# GameState.addGameObject怎麽用?C# GameState.addGameObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GameState的用法示例。


在下文中一共展示了GameState.addGameObject方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: fire

 public virtual void fire(Entity me, GameState environment)
 {
     Entity bomb = new Entity(ProjectilePrototype);
     Stats.CurrentCooldown = Stats.Cooldown;
     bomb.Physics.Position = me.Source.Physics.Position;
     bomb.Status = new Statuses.ExpireCheck(Stats.Duration);
     bomb.Collidable.Radius = (int) Stats.Radius;
     bomb.CollisionHandler = new CollisionHandlers.GravityWell(Stats.Radius, Stats.EffectParam);
     environment.addGameObject(bomb);
 }
開發者ID:realcore,項目名稱:progark-spill,代碼行數:10,代碼來源:GravityWell.cs

示例2: decide

 public void decide(Entity me, GameState environment, float timedelta, GameStateStack states)
 {
     if (me.CombatStats.CurrentCooldown <= 0)
     {
         Entity newCreep = new Entity();
         // This should be done by some factory or other
         // Alternatively, make sure that actual copying is taking place
         newCreep.Physics.Position = me.Physics.Position;
         newCreep.Behaviour = Prototype.Behaviour;
         newCreep.CollisionHandler = Prototype.CollisionHandler;
         newCreep.Renderable = Prototype.Renderable;
         newCreep.Source = me;
         newCreep.Status = Prototype.Status;
         newCreep.Collidable = Prototype.Collidable;
         newCreep.CombatStats = Prototype.CombatStats;
         me.CombatStats.CurrentCooldown = me.CombatStats.Cooldown;
         environment.addGameObject(newCreep);
     }
 }
開發者ID:realcore,項目名稱:progark-spill,代碼行數:19,代碼來源:CreepSpawnBehaviour.cs


注:本文中的GameState.addGameObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。