// Update is called once per frame void Update() { currentTime += Time.deltaTime; switch (state) { case State.wait: if (currentTime >= waitTime) { state = State.jump; pathFollower.Resume(isFlipped); spriteAnim.Resume(); currentTime = 0; } break; case State.jump: if (currentTime >= jumpTime) { state = State.wait; isFlipped = !isFlipped; pathFollower.Pause(); spriteAnim.Pause(); currentTime = 0; } break; } }
void CombinedEnter() { SfxManager.instance.PlaySound(SoundType.SLIME_COMBINE); animator.Pause(); this.currentWobbleIntensity = wobbleIntensity; this.currentWobbleSpeed = wobbleSpeed; }
public Lunger(Texture2D spritesheet, Rectangle hitbox, List<Vector2> hitPolyPoints, Vector2 hitboxoffset) : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset) { _idleAnim = new SpriteAnim(spritesheet, 5, 6, 16, 16, 100, new Vector2(8, 8), false, false, 0); _idleAnim.Pause(); _hitAnim = new SpriteAnim(spritesheet, 11, 6, 16, 16, 100, new Vector2(8, 8), false, false, _idleAnim.CurrentFrame); _hitAnim.Pause(); }
public Lunger(Texture2D spritesheet, Rectangle hitbox, List <Vector2> hitPolyPoints, Vector2 hitboxoffset) : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset) { _idleAnim = new SpriteAnim(spritesheet, 5, 6, 16, 16, 100, new Vector2(8, 8), false, false, 0); _idleAnim.Pause(); _hitAnim = new SpriteAnim(spritesheet, 11, 6, 16, 16, 100, new Vector2(8, 8), false, false, _idleAnim.CurrentFrame); _hitAnim.Pause(); }
public Gorger(Texture2D spritesheet, Rectangle hitbox, List <Vector2> hitPolyPoints, Vector2 hitboxoffset) : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset) { _idleAnim = new SpriteAnim(spritesheet, 3, 6, 16, 16, 100, new Vector2(8, 8), false, false, 0); _idleAnim.Pause(); _hitAnim = new SpriteAnim(spritesheet, 9, 6, 16, 16, 100, new Vector2(8, 8), false, false, _idleAnim.CurrentFrame); _hitAnim.Pause(); Speed.Y = Helper.RandomFloat(-0.2f, 0.2f); }
public Gorger(Texture2D spritesheet, Rectangle hitbox, List<Vector2> hitPolyPoints, Vector2 hitboxoffset) : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset) { _idleAnim = new SpriteAnim(spritesheet, 3, 6, 16, 16, 100, new Vector2(8, 8), false, false, 0); _idleAnim.Pause(); _hitAnim = new SpriteAnim(spritesheet, 9, 6, 16, 16, 100, new Vector2(8, 8), false, false, _idleAnim.CurrentFrame); _hitAnim.Pause(); Speed.Y = Helper.RandomFloat(-0.2f, 0.2f); }
public Flyer(Texture2D spritesheet, Rectangle hitbox, List<Vector2> hitPolyPoints, Vector2 hitboxoffset) : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset) { _idleAnim = new SpriteAnim(spritesheet, 0, 1, 16, 16, 100, new Vector2(8, 8), false, false, 0); _idleAnim.Pause(); _hitAnim = new SpriteAnim(spritesheet, 6, 1, 16, 16, 100, new Vector2(8, 8), false, false, _idleAnim.CurrentFrame); _hitAnim.Pause(); _faceDir = Helper.Random.Next(2) == 0 ? -1 : 1; gunLoop = AudioController.CreateInstance("minigun"); gunLoop.IsLooped = true; gunLoop.Volume = 0f; gunLoop.Play(); gunLoop.Pause(); }
public Flyer(Texture2D spritesheet, Rectangle hitbox, List <Vector2> hitPolyPoints, Vector2 hitboxoffset) : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset) { _idleAnim = new SpriteAnim(spritesheet, 0, 1, 16, 16, 100, new Vector2(8, 8), false, false, 0); _idleAnim.Pause(); _hitAnim = new SpriteAnim(spritesheet, 6, 1, 16, 16, 100, new Vector2(8, 8), false, false, _idleAnim.CurrentFrame); _hitAnim.Pause(); _faceDir = Helper.Random.Next(2) == 0 ? -1 : 1; gunLoop = AudioController.CreateInstance("minigun"); gunLoop.IsLooped = true; gunLoop.Volume = 0f; gunLoop.Play(); gunLoop.Pause(); }
public Ship(Texture2D spritesheet, Rectangle hitbox, List <Vector2> hitPolyPoints, Vector2 hitboxoffset) : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset) { Instance = this; engineLoop = AudioController.CreateInstance("boost"); engineLoop.Volume = 0f; engineLoop.IsLooped = true; engineLoop.Play(); engineLoop.Pause(); engineLoop.Volume = 0.3f; gunLoop = AudioController.CreateInstance("minigun"); gunLoop.IsLooped = true; gunLoop.Volume = 0f; gunLoop.Play(); gunLoop.Pause(); gunLoop.Volume = 0.3f; hitLoop = AudioController.CreateInstance("shiphit"); hitLoop.IsLooped = false; hitLoop.Volume = 1f; _idleAnim = new SpriteAnim(spritesheet, 0, 1, 16, 16, 100, new Vector2(8, 8)); _idleAnim.Play(); _upAnim = new SpriteAnim(spritesheet, 1, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0); _upAnim.Pause(); _downAnim = new SpriteAnim(spritesheet, 2, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0); _downAnim.Pause(); _idleHitAnim = new SpriteAnim(spritesheet, 3, 1, 16, 16, 100, new Vector2(8, 8)); _idleHitAnim.Play(); _upHitAnim = new SpriteAnim(spritesheet, 4, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0); _upHitAnim.Pause(); _downHitAnim = new SpriteAnim(spritesheet, 5, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0); _downHitAnim.Pause(); Active = true; }
public Ship(Texture2D spritesheet, Rectangle hitbox, List<Vector2> hitPolyPoints, Vector2 hitboxoffset) : base(spritesheet, hitbox, hitPolyPoints, hitboxoffset) { Instance = this; engineLoop = AudioController.CreateInstance("boost"); engineLoop.Volume = 0f; engineLoop.IsLooped = true; engineLoop.Play(); engineLoop.Pause(); engineLoop.Volume = 0.3f; gunLoop = AudioController.CreateInstance("minigun"); gunLoop.IsLooped = true; gunLoop.Volume = 0f; gunLoop.Play(); gunLoop.Pause(); gunLoop.Volume = 0.3f; hitLoop = AudioController.CreateInstance("shiphit"); hitLoop.IsLooped = false; hitLoop.Volume = 1f; _idleAnim = new SpriteAnim(spritesheet, 0, 1, 16, 16, 100, new Vector2(8, 8)); _idleAnim.Play(); _upAnim = new SpriteAnim(spritesheet, 1, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0); _upAnim.Pause(); _downAnim = new SpriteAnim(spritesheet, 2, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0); _downAnim.Pause(); _idleHitAnim = new SpriteAnim(spritesheet, 3, 1, 16, 16, 100, new Vector2(8, 8)); _idleHitAnim.Play(); _upHitAnim = new SpriteAnim(spritesheet, 4, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0); _upHitAnim.Pause(); _downHitAnim = new SpriteAnim(spritesheet, 5, 2, 16, 16, 500, new Vector2(8, 8), false, false, 0); _downHitAnim.Pause(); Active = true; }
// Use this for initialization void Start() { // if( m_MoveDir.x != 1 && m_MoveDir.y != 1 && m_MoveDir.z != 1 && m_MoveDir.x != -1 && m_MoveDir.y != -1 && m_MoveDir.z != -1 ) { Debug.LogWarning( "The MoveDir is invalid. Set it to default.", this ); m_MoveDir = Vector3.right; } UIEventTrigger trigger = this.transform.GetComponent<UIEventTrigger>(); if(trigger == null) { trigger = this.gameObject.AddComponent<UIEventTrigger>(); } EventDelegate.Add(trigger.onHoverOver,this.OnHoverIn); EventDelegate.Add(trigger.onHoverOut,this.OnHoverOut); m_SpriteAnim = this.GetComponent<SpriteAnim>(); if( m_SpriteAnim == null ) Debug.LogWarning( "This GameObject has not Component:'SpriteAnim'.", this ); else m_SpriteAnim.Pause(); // StartCoroutine( DelayInit() ); }