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


C# FSprite.RemoveFromContainer方法代码示例

本文整理汇总了C#中FSprite.RemoveFromContainer方法的典型用法代码示例。如果您正苦于以下问题:C# FSprite.RemoveFromContainer方法的具体用法?C# FSprite.RemoveFromContainer怎么用?C# FSprite.RemoveFromContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FSprite的用法示例。


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

示例1: HandlePlayerCollision

 public void HandlePlayerCollision(Player p)
 {
     if (p.isColliding(this))
     {
         //FSoundManager.PlaySound("powerup");
         isBeingPickedUp = true;
         FSoundManager.TweenVolume(.3f);
         p.isVisible = false;
         Go.killAllTweensWithTarget(p);
         p.State = Player.PlayerState.IDLE;
         p.xVel = 0;
         p.yVel = 0;
         Go.killAllTweensWithTarget(this);
         FSprite playerPickup = new FSprite("player_13");
         C.getCameraInstance().AddChild(playerPickup);
         Vector2 playerRelativePosition = p.GetPosition() + Futile.stage.GetPosition() - Vector2.up * 16f;
         playerPickup.SetPosition(playerRelativePosition);
         this.SetPosition(this.GetPosition() + Futile.stage.GetPosition() - Vector2.up * 16f);
         world.removeObject(this);
         C.getCameraInstance().AddChild(this);
         world.forceWaitLoad = true;
         RXDebug.Log(this.GetPosition(), playerPickup.GetPosition());
         this.MoveToFront();
         FLabel label = new FLabel(C.largeFontName, type.ToString().ToUpper() + " SPIRIT");
         C.getCameraInstance().AddChild(label);
         label.y = Futile.screen.halfHeight - label.textRect.height / 2f - 10;
         label.x = Futile.screen.halfWidth + label.textRect.width / 2f + 10;
         world.ShowLoading(() =>
         {
             Go.to(playerPickup, 2.0f, new TweenConfig().floatProp("x", 0).floatProp("y", -15).setEaseType(EaseType.QuadOut));
             Go.to(this, 2.0f, new TweenConfig().floatProp("x", 0).floatProp("y", 15).setEaseType(EaseType.QuadOut));
             Go.to(label, 1.5f, new TweenConfig().floatProp("x", 0).setEaseType(EaseType.BackOut).setDelay(1.5f).onComplete(() =>
             {
                 Go.to(this, .01f, new TweenConfig().floatProp("x", 1, true).onComplete(() =>
                 {
                     Go.to(this, .01f, new TweenConfig().floatProp("x", -2, true).setIterations(100, LoopType.PingPong).onComplete(() =>
                     {
                         FSoundManager.PlaySound("orbExplosion");
                         FSoundManager.PlaySound("powerup");
                         SpawnParticles(30);
                         this.x -= 1;
                         sprite.SetElementByName(type.ToString().ToLower() + "_soul");
                         Go.to(label, 1.5f, new TweenConfig().floatProp("x", -Futile.screen.halfWidth - label.textRect.width / 2f - 10).setEaseType(EaseType.BackIn).setDelay(2.0f).onStart((AbstractTween t) => { }).onComplete(() =>
                         {
                             label.RemoveFromContainer();
                             Go.to(playerPickup, 1.0f, new TweenConfig().floatProp("x", playerRelativePosition.x).floatProp("y", playerRelativePosition.y).setEaseType(EaseType.QuadInOut).onComplete(() =>
                             {
                                 FSoundManager.TweenVolume(1.0f);
                                 p.PickupSoul(this);
                                 world.HideLoading(() => { p.isVisible = true; playerPickup.RemoveFromContainer(); this.RemoveFromContainer(); });
                             }));
                             Vector2 powerupPos;
                             switch(type)
                             {
                                 case SoulType.JUMP:
                                     powerupPos = world.ui.slotAPos;
                                     break;
                                 default:
                                     powerupPos = world.ui.slotBPos;
                                     break;
                             }
                             Go.to(this, 1.0f, new TweenConfig().floatProp("x", powerupPos.x).floatProp("y", powerupPos.y).setEaseType(EaseType.QuadInOut));
                         }));
                     }));
                 }));
             }));
         });
     }
 }
开发者ID:maggardJosh,项目名称:SpiritGuard,代码行数:69,代码来源:SoulPickup.cs

示例2: AddHealth

    public void AddHealth(int health, Vector2 pos)
    {
        for (int i = this.health; i < health; i++)
        {
            FSprite heart = new FSprite("heart");

            heart.SetPosition(pos);
            Vector2 targetPos = hearts.GetPosition();
            switch (i)
            {
                case 0: targetPos.x -= 10; break;
                case 1: break;
                case 2: targetPos.x += 10; break;
            }

            this.AddChild(heart);
            Go.to(heart, .7f, new TweenConfig().floatProp("x", targetPos.x).floatProp("y", targetPos.y).setEaseType(EaseType.QuadOut).onComplete(() => { setHealthSprite(this.health); heart.RemoveFromContainer(); }));
        }
        this.health = health;
    }
开发者ID:maggardJosh,项目名称:SpiritGuard,代码行数:20,代码来源:UI.cs

示例3: TakeDamage

 public void TakeDamage(int health)
 {
     for (int i = this.health; i > health; i--)
     {
         FSprite heart = new FSprite("heart");
         heart.SetPosition(hearts.GetPosition());
         switch (i)
         {
             case 1: heart.x -= 10; break;
             case 2: break;
             case 3: heart.x += 10; break;
         }
         this.AddChild(heart);
         Go.to(heart, .7f, new TweenConfig().floatProp("y", -15, true).setEaseType(EaseType.BackOut).onComplete(() => { heart.RemoveFromContainer(); }));
     }
     this.health = health;
     setHealthSprite(health);
 }
开发者ID:maggardJosh,项目名称:SpiritGuard,代码行数:18,代码来源:UI.cs

示例4: KillHeart

 public void KillHeart(FSprite heart)
 {
     Go.killAllTweensWithTarget(heart);
     hearts.Remove(heart);
     heart.RemoveFromContainer();
 }
开发者ID:wtrebella,项目名称:First-Year-Anniversary-Game,代码行数:6,代码来源:TClickHeartsScene.cs


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