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


C# Wave类代码示例

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


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

示例1: Sheep

        public Sheep(RenderContext rc, float3 position, float3 rotation, float3 scaleFactor,  SceneRenderer sc, Game game)
            : base(rc, position, rotation, scaleFactor, sc)
        {
            _distance = position.Length;
            if (_distance > 60)
            {
                _score = 120;
            }
            if (_distance > 40)
            {
                _score = 80;
            }
            else
            {
                _score = 50;
            }
            Speed = (5 / _distance) * game.Level;
            Radius = 4f;
            _game = game;
            Pos = position;
            _alpha = (float)Math.Tan(Pos.z/Pos.x);
            Tag = "Sheep";
            _level = 1;
            //zufällige Wellenbewegung

            if (position.x % 2 == 0)
            {
                TheWave = SinWave;
            }
            else
            {
                TheWave = CosWave;
            }
        }
开发者ID:GameProduction,项目名称:ScharfschiessenGame,代码行数:34,代码来源:Sheep.cs

示例2: Start

 //initilization
 void Start() {
     Wave SetWave = new Wave(maxAnimats, 0.5f);
     waves = new Wave[] { SetWave , SetWave , SetWave , SetWave , SetWave };
     FirstWave();
     FindObjectOfType<SunControls>().NightFall += RecallAnimats;
     FindObjectOfType<SunControls>().DayBreak += UnDock;
 }
开发者ID:CraigRUM,项目名称:Toy-Planet-Scripts,代码行数:8,代码来源:Spawner.cs

示例3: NextWave

    void NextWave()
    {
        currentWaveNumber++;
        if(currentWaveNumber -1 < waves.Length){
            currentWave = waves[currentWaveNumber-1];
        }

        enemiesRemainingToSpawn = currentWave.enemyCount;
        enemiesRemainingAlive = enemiesRemainingToSpawn;

        if(OnNewWave != null) {
            OnNewWave( currentWaveNumber );
        }
        ResetPlayerPosition();

        if (!currentWave.infinite)
        {
            gameUI.waveText.text = "Wave #: " + currentWaveNumber;
            gameUI.enemiesLeftText.text = "Enemies left: " + enemiesRemainingAlive;
        }
        else
        {
            gameUI.waveText.text = "Wave #: Infinite";
            gameUI.enemiesLeftText.text = "Enemies left: Infinite";
        }
    }
开发者ID:Malven,项目名称:TDS,代码行数:26,代码来源:Spawner.cs

示例4: Start

 void Start()
 {
     if (m_currentLevel.HasWavesRemaining)
     {
         m_currentWave = m_currentLevel.NextWave;
     }
 }
开发者ID:hocplyr98,项目名称:deathperception,代码行数:7,代码来源:LevelController.cs

示例5: CreateWave

 public Wave CreateWave(Round round)
 {
     // lookup pool by type
     Wave wave = new Wave(round.waves.Count);
     round.waves.Add(wave);
     return wave;
 }
开发者ID:Wttewaall,项目名称:3dhype-gamejam,代码行数:7,代码来源:Level2.cs

示例6: LaunchDelaySeconds

 private static float LaunchDelaySeconds(Wave original)
 {
     var delay = original.LaunchDelaySeconds  - .05f;
     if (delay < .4f)
         delay = .4f;
     return delay;
 }
开发者ID:Trifectgaming,项目名称:EdgeOnlineChallenge,代码行数:7,代码来源:GameManager.cs

示例7: PositionUpdateDelaySeconds

 private static float PositionUpdateDelaySeconds(Wave original)
 {
     var delay =  original.PositionUpdateDelaySeconds - .01f;
     if (delay < .2f)
         delay = .2f;
     return delay;
 }
开发者ID:Trifectgaming,项目名称:EdgeOnlineChallenge,代码行数:7,代码来源:GameManager.cs

示例8: LoadLevel

        private void LoadLevel(string levelName)
        {
            var doc = new XmlDocument();
            doc.Load("Assets/Resources/Levels/{0}.xml".ToFormat(levelName));
            var waves = doc.SelectSingleNode("Waves");

            foreach (XmlNode wave in waves.SelectNodes("Wave"))
            {
                var w = new Wave
                {
                    BeforeWaveDelay = float.Parse(wave.GetAttributeOrDefault("BeforeWaveDelay", "0")),
                    EnemiesToSpawn = new List<GameObject>()
                };

                foreach (XmlNode enemy in wave.SelectNodes("Enemy"))
                {
                    var e = (GameObject) Instantiate(
                        Resources.Load("Prefabs/Enemies/" + enemy.GetAttributeOrDefault("Type", "Popcorn")));
                    var ecom = e.GetComponent<Enemy>();
                    ecom.X = float.Parse(enemy.GetAttributeOrDefault("X", "0"));
                    ecom.Spawn = float.Parse(enemy.GetAttributeOrDefault("Spawn", "0"));
                    ecom.Speed = float.Parse(enemy.GetAttributeOrDefault("Speed", "5"));
                    ecom.transform.Translate(0, 20, 0);
                    e.gameObject.SetActive(false);

                    w.EnemiesToSpawn.Add(e);
                }

                _waves.Add(w);
            }
        }
开发者ID:EricFreeman,项目名称:Unity2D-Test,代码行数:31,代码来源:Director.cs

示例9: Start

	void Start() 
    {
        if (StartSpawning)
            Spawning = true;

        CurrentWave = Waves[0];
	}
开发者ID:Xellss,项目名称:GGJ2016,代码行数:7,代码来源:Spawner.cs

示例10: CheckForNewWave

 private void CheckForNewWave()
 {
     if (Waves.IndexOf(CurrentWave) != GameManager.CurrentStage)
     {
         CurrentWave = Waves[GameManager.CurrentStage - 1];
     }
 }
开发者ID:Xellss,项目名称:StrangeRituals,代码行数:7,代码来源:ContinouslyWaveSpawner.cs

示例11: NextWave

    private void NextWave()
    {
        currentWaveNumber++;
        currentWave = waves[currentWaveNumber - 1];

        enemyRemainingToSpawn = currentWave.enemyCount;
    }
开发者ID:tryonn,项目名称:ShootAdventure,代码行数:7,代码来源:Spawner.cs

示例12: Start

    //public Seq[] sequences;
    // Use this for initialization
    void Start()
    {
        var cz = GetComponent<CombatZone>();
        var wCount = 0;
        foreach (Wav wav in waves) {
            var w = new Wave();
            cz.spawnWaves.Add(w);
            cz.spawnWaves[wCount].delayNextSeq = wav.delaySeq;
            foreach (Seq seq in wav.sequences) {

                    var sq = new Sequence ();
                    cz.spawnWaves [wCount].spawnSeqs.Add (sq);
                    sq.delayNextEvent = seq.delay;
                    sq.pos = seq.pos;
                    for (int i=0; i<seq.amount; i ++) {
                            var e = new SpawnEvent ();//sq.spawnEvents[i];
                            e.enemyType = seq.eType;
                            e.equipped = seq.equipped;
                            e.paratrooper = seq.chute;
                            Vector2 p = transform.position;
                            e.offset = p + sq.pos + (seq.offset * i);
                            sq.spawnEvents.Add (e);
                    }

            }
            wCount++;
        }
    }
开发者ID:Libeedo,项目名称:psycho-bob,代码行数:30,代码来源:CombatZoneManager.cs

示例13: SpawnWave

 void SpawnWave(Wave w)
 {
     for (int i = 0; i < w.waves.Length; i++) {
         SpawnEnnemy (w.waves [i].number, w.waves [i].health, w.waves [i].speed, w.waves [i].color, w.waves [i].size, (float)(i * 1.2f));
     }
     waveSpawnEnd = true;
 }
开发者ID:Saymon16,项目名称:Nullachier-TD,代码行数:7,代码来源:Spawner.cs

示例14: SpawnWave

 /// <summary>
 /// Spawns a wave of enemies
 /// </summary>
 /// <param name="wave">a Wave object containing enemies</param>
 /// <returns>A time in seconds to wait</returns>
 IEnumerator SpawnWave(Wave wave)
 {
     foreach (string enemy in wave.wave)
     {
         SpawnEnemy(enemy);
         yield return new WaitForSeconds(2);
     }
 }
开发者ID:nallelcm,项目名称:TD,代码行数:13,代码来源:GameManager.cs

示例15: Round

 // ---- getters & setters ----
 // ---- constructor ----
 public Round()
 {
     this.OnIndexChange += delegate {
         SetEventHandlers(currentWave, false);
         currentWave = selectedItem as Wave;
         SetEventHandlers(currentWave, true);
     };
 }
开发者ID:Wttewaall,项目名称:3dhype-gamejam,代码行数:10,代码来源:Round.cs


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