public void Attack(Rabit rabbit) { IsShooting = true; BulletAppear = Time.time; RigidBody.constraints = RigidbodyConstraints2D.FreezePosition; float direction = GetBulletDirection(); Debug.Log(direction); if (direction < 0) { Sprite.flipX = false; Debug.Log("left"); } else { Sprite.flipX = true; Debug.Log("right"); } LaunchCarrot(direction); this.Animator.SetTrigger("Attack"); RigidBody.constraints = RigidbodyConstraints2D.FreezeRotation; }
// Use this for initialization void Start() { rabit = this; rBody = GetComponent <Rigidbody2D>(); sr = GetComponent <SpriteRenderer>(); LevelControler.current.setStartPosition(transform.position); rabitParent = transform.parent; }
void OnTriggerEnter2D(Collider2D collider) { Rabit rabit = collider.GetComponent <Rabit> (); if (rabit != null) { LevelControler.current.RabitDeath(rabit); } }
void OnTriggerEnter2D(Collider2D collider) { if (!hideAnimation) { Rabit rabit = collider.GetComponent <Rabit>(); if (rabit != null) { onRabitHit(rabit); } } }
protected override void onRabitHit(Rabit rabit) { LevelControler.current.addCoins(1); CoinsLabel.NCoinsCounter.UpdateCoins(LevelControler.current.coins); CollectedHide(); }
protected override void onRabitHit(Rabit rabit) { LevelControler.current.addFruits(1); CollectedHide(); }
bool hideAnimation = false; //? protected virtual void onRabitHit(Rabit rabit) { }
protected override void onRabitHit(Rabit rabit) { rabit.startGetingBiger(); CollectedHide(); }
protected override void onRabitHit(Rabit rabit) { rabit.onBomb(); CollectedHide(); }
protected override void onRabitHit(Rabit rabit) { LevelControler.current.addCrystals(1); CrystalsUI.crystalsUI.setCrystalCollected(id); CollectedHide(); }
protected override void onRabitHit(Rabit rabit) { LevelControler.current.RabitDeath(rabit); CollectedHide(); }
public void RabitDeath (Rabit rabit) { //tmp = rabit; LifesUI.lifesUI.OnDeathUI(lifes); --lifes; rabit.transform.position = this.startPos; }