public void RegisterEndAnimation(bool roundEnd, float startSpeed = 0, bool parallel = true) { PassTurnStartAnimation pass = passStone.GetAnimation <PassTurnStartAnimation>(); if (roundEnd) { pass.Init(GetPlayerForRound(round + 1)); animationManager.Add(pass); if (parallel) { animationManager.AddToLastInParallel(board.GetAnimation <RoundEndAnimation>()); } else { animationManager.Add(board.GetAnimation <RoundEndAnimation>()); } } else { pass.Init(GetOtherPlayer(currentPlayer), startSpeed); animationManager.Add(pass); } Player nextPlayer = roundEnd ? GetPlayerForRound(round + 1) : GetOtherPlayer(currentPlayer); RotateBoardAnimation rba = board.GetAnimation <RotateBoardAnimation>(); rba.Init(nextPlayer); animationManager.AddToLastInParallel(rba); }
public void Init(Unit a, Unit b) { AnimationManager am = Game.MAIN.animationManager; am.Add(Move(a, b.field.transform.position + Vector3.up * 1f)); am.AddToLastInParallel(Move(b, a.field.transform.position + Vector3.up * 0.5f)); am.Add(Move(a, a.field.transform.position + Vector3.up * 1f)); am.AddToLastInParallel(Move(b, b.field.transform.position + Vector3.up * 0.5f)); am.Add(Move(a, a.field.transform.position)); am.AddToLastInParallel(Move(b, b.field.transform.position)); //Destroy(gameObject); }
public Player() { Speed = 0.2f; AnimationManager = new AnimationManager(); AnimationManager.Add(new Animation(new Texture("Resources\\Textures\\Heroes\\Coub\\Coub.png"), new Vector2i(0, 0), new Vector2i(16, 16), 6, 1300), "AFK"); AnimationManager.Current = "AFK"; }
public override Display GetView() { var animManager = new AnimationManager(); var frameSize = new Vector2(30, 36); var sprite = new Sprite(textureManager.Get(Images.Instance.GameTextures), frameSize, Layers.Tank); animManager .Add(StandUp, new Clip(sprite, new Vector2(240, 72))) .Add(StandDown, new Clip(sprite, new Vector2(0, 72))) .Add(StandLeft, new Clip(sprite, new Vector2(120, 72))) .Add(StandRight, new Clip(sprite, new Vector2(360, 72))) .Add(TurnLeftDown, new Clip(sprite, new Vector2(0, 72), 5, delay, true, true)) .Add(TurnLeftUp, new Clip(sprite, new Vector2(120, 72), 5, delay, true)) .Add(TurnRightDown, new Clip(sprite, new Vector2(360, 72), 5, delay, true)) .Add(TurnRightUp, new Clip(sprite, new Vector2(240, 72), 5, delay, true, true)) .Add(TurnUpLeft, new Clip(sprite, new Vector2(120, 72), 5, delay, true, true)) .Add(TurnUpRight, new Clip(sprite, new Vector2(240, 72), 5, delay, true)) .Add(TurnDownLeft, new Clip(sprite, new Vector2(0, 72), 5, delay, true)) .Add(TurnDownRight, new Clip(sprite, new Vector2(360, 72), 5, delay, true, true)) .Add(TurnUpDown, new Clip(sprite, new Vector2(240, 72), 9, delay, true)) .Add(TurnDownUp, new Clip(sprite, new Vector2(0, 72), 9, delay, true)) .Add(TurnLeftRight, new Clip(sprite, new Vector2(120, 72), 9, delay, true)) .Add(TurnRightLeft, new Clip(sprite, new Vector2(360, 72), 9, delay, true)) .Change(AntEnum.Parse <Animations>(((int)direction).ToString())); return(new Display(animManager, 0, -3)); }
/// <inheritdoc/> protected override void OnInitialize(AnimationManager animationManager) { // Start fade-in animation on animation weight. var fadeInAnimation = new SingleFromToByAnimation { From = 0, Duration = _fadeInDuration, EasingFunction = DefaultEase, FillBehavior = FillBehavior.Stop, }; animationManager.StartAnimation(fadeInAnimation, AnimationInstance.WeightProperty); animationManager.Add(AnimationInstance, HandoffBehavior.Compose, _previousAnimation); animationManager.Remove(this); }
/// <inheritdoc/> protected override void OnInitialize(AnimationManager animationManager) { // Start fade-in animation on animation weight. var fadeInAnimation = new SingleFromToByAnimation { From = 0, Duration = _fadeInDuration, EasingFunction = DefaultEase, FillBehavior = FillBehavior.Stop, }; _fadeInController = animationManager.StartAnimation(fadeInAnimation, AnimationInstance.WeightProperty); // Add animation. animationManager.Add(AnimationInstance, HandoffBehavior.Compose, null); }
// Start is called before the first frame update void Start() { if (GameLaunchInfo.aiGame) { ModifyToAI(); } game.Initialize(); descriptionBoard.CreateFields(); //descriptionBoard.transform.localScale *= 7f/8f; Player startingPlayer = game.SetRandomStartingPlayer(5); // Pre game animations AnimationManager am = game.animationManager; // Coin Flip CoinFlipAnimation cfa = GetAnimation <CoinFlipAnimation>(); am.Add(GetAnimation <CoinFlipAnimation>()); game.RegisterEndAnimation(roundEnd: true, startSpeed: cfa.maxAV, parallel: false); //am.AddToLastInParallel(GetAnimation<CameraInitAnimation>()); am.StartAnimations(); }
/// <inheritdoc/> protected override void OnInitialize(AnimationManager animationManager) { animationManager.Add(AnimationInstance, HandoffBehavior.Compose, _previousAnimation); animationManager.Remove(_previousAnimation); animationManager.Remove(this); }
/// <inheritdoc/> protected override void OnInitialize(AnimationManager animationManager) { animationManager.Add(AnimationInstance, HandoffBehavior.Replace, null); animationManager.Remove(this); }
/// <inheritdoc/> protected override void OnInitialize(AnimationManager animationManager) { animationManager.Add(AnimationInstance, HandoffBehavior.Compose, _previousAnimation); animationManager.Remove(this); }
/// <inheritdoc/> protected override void OnInitialize(AnimationManager animationManager) { animationManager.Add(AnimationInstance, HandoffBehavior.SnapshotAndReplace, null); animationManager.Remove(this); }