mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 18:57:40 +02:00
Shoot-'em-up (#796)
* 無駄 * spawn * Start Interval * new sprites, background particles * fix white flash * wip hit particle * finished hit particle * oops * oops2 * sorry last tweak * Damage * Merge manually * modified: Update() * fix particle layering * tweak particle more * more enemies * Changed the way effects are generated * animation fixes * attack fix * laser and enemy miss anim * sorry!!!!!!!!! * monitor animations * intro gate animations * trajectory * Pass Turn (WIP) * Animation Event * Fine placement * Pass Turn * Placement Pattern * EnemyType * icon * fix bg, fix animations, added smoke particle * Adding and modifying effects * I made a mistake in the operation --------- Co-authored-by: ev <85412919+evdial@users.noreply.github.com> Co-authored-by: ev <85412919+iloveoatmeal2022@users.noreply.github.com>
This commit is contained in:
42
Assets/Scripts/Games/ShootEmUp/Ship.cs
Normal file
42
Assets/Scripts/Games/ShootEmUp/Ship.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using HeavenStudio.Util;
|
||||
|
||||
namespace HeavenStudio.Games.Scripts_ShootEmUp
|
||||
{
|
||||
public class Ship : MonoBehaviour
|
||||
{
|
||||
public Animator shipAnim;
|
||||
public Animator laserAnim;
|
||||
public Animator damageAnim;
|
||||
|
||||
public bool isDamage = false;
|
||||
// int life = 24;
|
||||
|
||||
public void Shoot()
|
||||
{
|
||||
shipAnim.DoScaledAnimationAsync("shipShoot", 1f);
|
||||
laserAnim.DoScaledAnimationAsync("laser", 1f);
|
||||
}
|
||||
|
||||
public void Damage()
|
||||
{
|
||||
// if (life > 0) {
|
||||
// life = Mathf.Max(life - 8, 0);
|
||||
// } else {
|
||||
// // Gameover if you miss in next interval
|
||||
// }
|
||||
|
||||
isDamage = true;
|
||||
shipAnim.DoScaledAnimationAsync("shipDamage", 1f);
|
||||
damageAnim.DoScaledAnimationAsync("damage", 0.5f);
|
||||
}
|
||||
|
||||
public void DamageEnd()
|
||||
{
|
||||
isDamage = false;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user