当前位置: 首页>>代码示例>>C#>>正文


C# Spaceship类代码示例

本文整理汇总了C#中Spaceship的典型用法代码示例。如果您正苦于以下问题:C# Spaceship类的具体用法?C# Spaceship怎么用?C# Spaceship使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Spaceship类属于命名空间,在下文中一共展示了Spaceship类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ObjectInitalizer

 static void ObjectInitalizer()
 {
     Spaceship spaceship = new Spaceship()
     {
         Health = 30
     };
 }
开发者ID:iq110,项目名称:csharpgameprogramming,代码行数:7,代码来源:Program.cs

示例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");
    }
开发者ID:jansou,项目名称:ScrollShooting,代码行数:33,代码来源:Nabatea.cs

示例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);
        }
    }
开发者ID:jansou,项目名称:ScrollShooting,代码行数:27,代码来源:Blossom.cs

示例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;
    }
开发者ID:jansou,项目名称:ScrollShooting,代码行数:25,代码来源:Archer.cs

示例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));
        }
开发者ID:julius,项目名称:pse_spacewar,代码行数:25,代码来源:WorldTest.cs

示例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;
    }
开发者ID:jansou,项目名称:ScrollShooting,代码行数:26,代码来源:DummyBom.cs

示例7: Formationmember

 public Formationmember(Spaceship ship, float range, bool left, Transform leader)
     : base(ship, range)
 {
     actual = Manouver.FormationMember;
     leaderBacker = leader;
     this.left = left;
 }
开发者ID:Failender,项目名称:Spaceship,代码行数:7,代码来源:Formationmember.cs

示例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);

		}

			
	}
开发者ID:daisukemizukami,项目名称:2d-shooting-game-master,代码行数:26,代码来源:Enemy.cs

示例9: Start

 void Start()
 {
     mEmitter = GetComponent<ParticleEmitter>();
     mControl = Tools.FindInParents<Spaceship>(transform);
     mEmission = new Vector2(mEmitter.minEmission, mEmitter.maxEmission);
     mDir = transform.rotation * Vector3.back;
 }
开发者ID:Greigy,项目名称:TheGame,代码行数:7,代码来源:ShipThrusterEmitter.cs

示例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);
        }
    }
开发者ID:Ellurein,项目名称:Tutorial,代码行数:29,代码来源:Enemy.cs

示例11: Start

 void Start()
 {
     mLight = GetComponent<Light>();
     mOriginal = mLight.intensity;
     mTarget = mOriginal;
     mControl = Tools.FindInParents<Spaceship>(transform);
     mDir = transform.rotation * Vector3.back;
 }
开发者ID:Greigy,项目名称:TheGame,代码行数:8,代码来源:ShipThrusterLight.cs

示例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;
	}
开发者ID:darajad,项目名称:Lethal-Pursuit,代码行数:8,代码来源:PickupFlamethrower.cs

示例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;
 }
开发者ID:saihe,项目名称:Unity,代码行数:10,代码来源:Enemy.cs

示例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);
    }
开发者ID:Failender,项目名称:Spaceship,代码行数:9,代码来源:Formation.cs

示例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);
    }
开发者ID:Greigy,项目名称:TheGame,代码行数:12,代码来源:DamageShield.cs


注:本文中的Spaceship类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。