本文整理汇总了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;
}
}
示例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;
}
示例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";
}
}
示例4: Start
void Start()
{
if (m_currentLevel.HasWavesRemaining)
{
m_currentWave = m_currentLevel.NextWave;
}
}
示例5: CreateWave
public Wave CreateWave(Round round)
{
// lookup pool by type
Wave wave = new Wave(round.waves.Count);
round.waves.Add(wave);
return wave;
}
示例6: LaunchDelaySeconds
private static float LaunchDelaySeconds(Wave original)
{
var delay = original.LaunchDelaySeconds - .05f;
if (delay < .4f)
delay = .4f;
return delay;
}
示例7: PositionUpdateDelaySeconds
private static float PositionUpdateDelaySeconds(Wave original)
{
var delay = original.PositionUpdateDelaySeconds - .01f;
if (delay < .2f)
delay = .2f;
return delay;
}
示例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);
}
}
示例9: Start
void Start()
{
if (StartSpawning)
Spawning = true;
CurrentWave = Waves[0];
}
示例10: CheckForNewWave
private void CheckForNewWave()
{
if (Waves.IndexOf(CurrentWave) != GameManager.CurrentStage)
{
CurrentWave = Waves[GameManager.CurrentStage - 1];
}
}
示例11: NextWave
private void NextWave()
{
currentWaveNumber++;
currentWave = waves[currentWaveNumber - 1];
enemyRemainingToSpawn = currentWave.enemyCount;
}
示例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++;
}
}
示例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;
}
示例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);
}
}
示例15: Round
// ---- getters & setters ----
// ---- constructor ----
public Round()
{
this.OnIndexChange += delegate {
SetEventHandlers(currentWave, false);
currentWave = selectedItem as Wave;
SetEventHandlers(currentWave, true);
};
}