本文整理汇总了C#中Spaceship类的典型用法代码示例。如果您正苦于以下问题:C# Spaceship类的具体用法?C# Spaceship怎么用?C# Spaceship使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Spaceship类属于命名空间,在下文中一共展示了Spaceship类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ObjectInitalizer
static void ObjectInitalizer()
{
Spaceship spaceship = new Spaceship()
{
Health = 30
};
}
示例2: Start
// Use this for initialization
IEnumerator Start()
{
spaceship = GetComponent<Spaceship> ();
common = GetComponent<EnemyCommon>();
enemy = GetComponent<Enemy>();
common.Init();
//
audioSource = gameObject.GetComponent<AudioSource>();
//
st = common.CreateShotPosition();
pt = FindObjectOfType<Party>().transform;
yield return new WaitForEndOfFrame();
yield return StartCoroutine("Stop");
audioSource.PlayOneShot(skillSE);
FindObjectOfType<MessageWindow>().showMessage("「星霜の記憶」");
stones = new GameObject[5];
stones[0] = (GameObject)Instantiate(stoneAlex,transform.position,Quaternion.identity);
stones[1] = (GameObject)Instantiate(stoneGuylus,transform.position,Quaternion.identity);
stones[2] = (GameObject)Instantiate(stoneNely,transform.position,Quaternion.identity);
stones[3] = (GameObject)Instantiate(stoneRinmaru,transform.position,Quaternion.identity);
stones[4] = (GameObject)Instantiate(stoneMedhu,transform.position,Quaternion.identity);
StartCoroutine("RotateStones");
StartCoroutine("Attack");
StartCoroutine("StonesSummon");
}
示例3: Start
IEnumerator Start()
{
spaceship = GetComponent<Spaceship> ();
common = GetComponent<EnemyCommon>();
common.Init();
Transform s1 = common.CreateShotPosition();
//SE関係
audioSource = gameObject.GetComponent<AudioSource>();
audioSource.clip = shootSE;
//
yield return new WaitForEndOfFrame();
while (true)
{
audioSource.PlayOneShot(shootSE);
common.Shot(s1, 0+30, power, speed, BulletManager.BulletType.BlossomBullet);
common.Shot(s1, 60 + 30, power, speed, BulletManager.BulletType.BlossomBullet);
common.Shot(s1, 120 + 30, power, speed, BulletManager.BulletType.BlossomBullet);
common.Shot(s1, 180 + 30, power, speed, BulletManager.BulletType.BlossomBullet);
common.Shot(s1, 240 + 30, power, speed, BulletManager.BulletType.BlossomBullet);
common.Shot(s1, 300 + 30, power, speed, BulletManager.BulletType.BlossomBullet);
yield return new WaitForSeconds(spaceship.shotDelay);
}
}
示例4: Start
IEnumerator Start()
{
spaceship = GetComponent<Spaceship> ();
common = GetComponent<EnemyCommon>();
enemy = GetComponent<Enemy>();
common.Init();
//SE関係
audioSource = gameObject.GetComponent<AudioSource>();
//
s1 = common.CreateShotPosition();
Party p = FindObjectOfType<Party>();
if(p){
pt = FindObjectOfType<Party>().transform;
}
yield return new WaitForEndOfFrame();
StartCoroutine("Stop");
StartCoroutine("Attack1");
yield break;
}
示例5: AddWorldObjectTest
public void AddWorldObjectTest()
{
Planet planet1 = new Planet();
WorldObject[] worldObjects = {planet1};
World target = new World(worldObjects);
WorldObject spaceship1 = new Spaceship();
WorldObject spaceship2 = new Spaceship();
WorldObject projectile = new Projectile();
WorldObject explosion = new Explosion();
WorldObject planet2 = new Planet();
target.AddWorldObject(spaceship1);
target.AddWorldObject(spaceship2);
target.AddWorldObject(projectile);
target.AddWorldObject(explosion);
target.AddWorldObject(planet2);
Assert.IsTrue((new List<WorldObject>(target.WorldObjects)).Contains(planet1));
Assert.IsTrue((new List<WorldObject>(target.WorldObjects)).Contains(spaceship1));
Assert.IsTrue((new List<WorldObject>(target.WorldObjects)).Contains(spaceship2));
Assert.IsTrue((new List<WorldObject>(target.WorldObjects)).Contains(projectile));
Assert.IsTrue((new List<WorldObject>(target.WorldObjects)).Contains(explosion));
Assert.IsTrue((new List<WorldObject>(target.WorldObjects)).Contains(planet2));
}
示例6: Start
// Use this for initialization
IEnumerator Start()
{
spaceship = GetComponent<Spaceship> ();
common = GetComponent<EnemyCommon>();
enemy = GetComponent<Enemy>();
common.Init();
//SE関係
audioSource = gameObject.GetComponent<AudioSource>();
audioSource.clip = shootSE;
//
s2 = common.CreateShotPosition();
pt = FindObjectOfType<Party>().transform;
//FindObjectOfType<MessageWindow>().showMessage("メテオ");
yield return new WaitForEndOfFrame();
//StartCoroutine("Stop");
StartCoroutine("Attack1");
yield break;
}
示例7: Formationmember
public Formationmember(Spaceship ship, float range, bool left, Transform leader)
: base(ship, range)
{
actual = Manouver.FormationMember;
leaderBacker = leader;
this.left = left;
}
示例8: Start
// Use this for initialization
IEnumerator Start () {
spaceship = GetComponent<Spaceship> ();
spaceship.Move (transform.up * -1);
if (spaceship.canShot == false) {
yield break;
}
while(true){
for(int i=0;i<transform.childCount;i++){
Transform shotPosition=transform.GetChild(i);
spaceship.Shot(shotPosition);
}
yield return new WaitForSeconds(spaceship.shotDelay);
}
}
示例9: Start
void Start()
{
mEmitter = GetComponent<ParticleEmitter>();
mControl = Tools.FindInParents<Spaceship>(transform);
mEmission = new Vector2(mEmitter.minEmission, mEmitter.maxEmission);
mDir = transform.rotation * Vector3.back;
}
示例10: Start
// Use this for initialization
IEnumerator Start()
{
//Spaceshipコンポーネントを取得
spaceship = GetComponent<Spaceship> ();
//ローカル座標のY軸のマイナス方向に移動
Move (transform.up * -1);
//canShotがfalseの場合、ここでコルーチンを終了させる
if (spaceship.canShot == false) {
yield break;
}
while (true) {
//子要素を全て取得する
for (int i = 0; i < transform.childCount; i++) {
Transform shotPosition = transform.GetChild(i);
//ShotPositionの位置/角度で弾を撃つ
spaceship.Shot (shotPosition);
}
// shotDelay秒待つ
yield return new WaitForSeconds (spaceship.shotDelay);
}
}
示例11: Start
void Start()
{
mLight = GetComponent<Light>();
mOriginal = mLight.intensity;
mTarget = mOriginal;
mControl = Tools.FindInParents<Spaceship>(transform);
mDir = transform.rotation * Vector3.back;
}
示例12: OnPickup
public override void OnPickup (Spaceship spaceship) {
base.OnPickup (spaceship);
laserBeamEffect.transform.localScale = Vector3.one;
laserBeamEffect.sourceTransform = spaceship.spaceshipModelPitchYaw.transform;
laserBeamEffectScript.laserMaxDistance = laserLength;
currentEnergy = maxEnergy;
active = true;
}
示例13: setSpeed
//Speedを変更
public float setSpeed(int level)
{
spaceship = GetComponent<Spaceship>();
print("Current Speed: " + spaceship.speed);
float speedUp = 1.0f + (level * 0.4f);
print("Speed UP: *" + speedUp);
spaceship.speed = spaceship.speed * speedUp;
return spaceship.speed;
}
示例14: Formation
public Formation(Spaceship ship, float range)
{
this.ship = ship;
rig = ship.GetComponent<Rigidbody>();
this.range = range;
actual = Manouver.Rotate;
nextAction = Random.Range(range / 2, 3 * range / 4);
}
示例15: Start
/// <summary>
/// Locate the spaceship and the power generator components.
/// </summary>
void Start()
{
mRen = GetComponent<Renderer>();
mMat = mRen.material;
Transform t = transform;
mShip = Tools.FindInParents<Spaceship>(t);
if (generator == null) generator = Tools.FindInParents<PowerGenerator>(t);
}