本文整理汇总了C#中Spawner类的典型用法代码示例。如果您正苦于以下问题:C# Spawner类的具体用法?C# Spawner怎么用?C# Spawner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Spawner类属于命名空间,在下文中一共展示了Spawner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpenAndSpawnByName
public void OpenAndSpawnByName(string passengerName, Spawner.TicketAdditionMode ticketMode)
{
_animator.enabled = true;
_animator.Play("doors_open");
_unitSpawner.Spawn(gameObject, passengerName, ticketMode);
_isOpened = true;
}
示例2: Awake
void Awake()
{
Application.targetFrameRate = 60;
player = GameObject.Find("Player").GetComponent<Player>();
spawner = GameObject.Find("Spawner").GetComponent<Spawner>();
Score = Hud.GetComponent<Score>();
}
示例3: Start
void Start()
{
_spawner = FindObjectOfType<Spawner>();
targetRoom = _spawner._rooms[Random.Range(0, _spawner._rooms.Count)];
destination = targetRoom.transform.position;
transform.position = targetRoom.transform.up*50f + targetRoom.transform.position;
}
示例4: BeginGame
private void BeginGame()
{
if (SpawnerPrefab != null) {
_spawnerInstance = Instantiate(SpawnerPrefab) as Spawner;
_spawnerInstance.Spawn();
}
}
示例5: Init
public override void Init(Spawner spawner)
{
base.Init(spawner);
VFX.Instance.ParentEffectIf("fire", transform, new Vector2(-0.85f, 1.7f), -Mathf.PI / 2, IsShooting);
VFX.Instance.ParentEffectIf("fire", transform, new Vector2(0.75f, 1.7f), -Mathf.PI / 2, IsShooting);
}
示例6: Awake
//private bool WeaponToggle;
void Awake()
{
floor = GameObject.Find ("Foreground");
spawner = GameObject.Find ("Spawner").GetComponent<Spawner> ();
//weaponmanager = GameObject.Find ("WeaponManager").GetComponent<WeaponManager>();
timeManager = GetComponent<TimeManager> ();
}
示例7: Start
void Start ()
{
gmc = GameObject.FindGameObjectWithTag("GameController").GetComponent<Spawner>();
print(gmc.sprites[gmc.num]);
/*anim = GameObject.FindGameObjectsWithTag("animation");
anim.SetActive(false);*/
skeletonAnimation = GameObject.FindGameObjectWithTag("animation").GetComponent<SkeletonAnimation>();
skeletonAnimation.enabled = true;
gmv = GameObject.FindGameObjectWithTag("GameOver");
cnt = GameObject.FindGameObjectWithTag("animation");
//gmv.SetActive(false);
gameOv =GameObject.FindGameObjectWithTag("GameOver").GetComponent<SkeletonAnimation>();
if(this.gameObject.GetComponent<TapCounter>().enabled){
skeletonAnimation.state.SetAnimation(0, "tap_amount_in", false);
skeletonAnimation.state.AddAnimation(0, "tap_amount_loop", true, 0.3f);
}
gmv.SetActive(false);
cnt.SetActive(true);
/*gmv = GameObject.FindGameObjectWithTag("GameOver");
cnt = GameObject.FindGameObjectWithTag("animation");
gmv.SetActive(false);*/
AudioSource[] sources = GetComponents<AudioSource>();
tap = sources[0];
bad = sources[1];
good = sources[2];
spw = GameObject.FindGameObjectWithTag("GameController").GetComponent<Spawner>();
sc = GameObject.FindGameObjectWithTag("Score").GetComponent<ScoreController>();
scoreCounter.text = "";
}
示例8: Start
void Start()
{
//Load the given objects from ressource folder, for later use
player = Resources.Load("Spaceships/Player", typeof(GameObject)) as GameObject;
pilotAI = Resources.Load("Spaceships/PlayerAI", typeof(GameObject)) as GameObject;
spawner = Resources.Load("Spawner", typeof(GameObject)) as GameObject;
combatHUD = Resources.Load("HUD/CombatHUD", typeof(GameObject)) as GameObject;
enemy = Resources.Load("Enemy", typeof(GameObject)) as GameObject;
enemyHUD = Resources.Load("HUD/EnemyHUD", typeof(GameObject)) as GameObject;
playerHUD = Resources.Load("HUD/PlayerHUD", typeof(GameObject)) as GameObject;
//Types of drops
commonDrop = Resources.Load("Drops/CommonDrop", typeof(GameObject)) as GameObject;
uncommonDrop = Resources.Load("Drops/UncommonDrop", typeof(GameObject)) as GameObject;
rareDrop = Resources.Load("Drops/RareDrop", typeof(GameObject)) as GameObject;
healthDrop = Resources.Load("Drops/HealthDrop", typeof(GameObject)) as GameObject;
shieldDrop = Resources.Load("Drops/ShieldDrop", typeof(GameObject)) as GameObject;
powerDrop = Resources.Load("Drops/PowerDrop", typeof(GameObject)) as GameObject;
getPlayers = GameObject.FindGameObjectsWithTag("Pilot");
getAIs = GameObject.FindGameObjectsWithTag("PilotAI");
Instantiate(spawner, new Vector2(10, 0), Quaternion.identity); // Spawn spawner
spawnerScript = GameObject.Find("Spawner(Clone)").GetComponent<Spawner>();
Instantiate(combatHUD, transform.position, Quaternion.identity); // Spawn AI GUI
waveOutcome = WaveOutcomes.Waiting;
#region Next Round timer
nextRoundTimer = new Timer(5000);
nextRoundTimer.Elapsed += new ElapsedEventHandler(NextRound);
nextRoundTimer.Enabled = true;
callNewRound = false;
#endregion
}
示例9: ShouldThrowExceptionIfProgramDoesntExist
public void ShouldThrowExceptionIfProgramDoesntExist()
{
using (var spawner = new Spawner())
{
Assert.Throws(typeof (ArgumentException), () => spawner.Spawn(new StartInfo {ProgramName = "asdf"}));
}
}
示例10: InitSpawners
public void InitSpawners()
{
for (int i = 0; i < spawners.Length; i++)
{
spawnerCon = spawners[i].GetComponent<Spawner> ();
spawnerCon.GetReady();
}
}
示例11: Awake
void Awake()
{
playerGoal = (Goal)GameObject.Find("PGoal").GetComponent(typeof(Goal));
shadowGoal = (Goal)GameObject.Find("SGoal").GetComponent(typeof(Goal));
player = GameObject.Find("Player");
shadow = GameObject.Find("Shadow");
spawner = (Spawner)gameObject.GetComponent(typeof(Spawner));
}
示例12: Start
// Use this for initialization
void Start()
{
steeringBasics = GetComponent<SteeringBasics>();
hide = GetComponent<Hide>();
obstacleSpawner = GameObject.Find("ObstacleSpawner").GetComponent<Spawner>();
wallAvoid = GetComponent<WallAvoidance>();
}
示例13: getInstance
public static Spawner getInstance () {
if(!instance) {
container = new GameObject();
container.name = "Spawner";
instance = container.AddComponent(typeof(Spawner)) as Spawner;
}
return instance;
}
示例14: Awake
void Awake ()
{
spawner = GetComponent<Spawner>();
maxHorizontalShift = GameSettings.SmallPlatformWidth / 2;
maxVerticalShift = GameSettings.SmallPlatformHeight / 2;
smallPlatformHeight = GameSettings.SmallPlatformHeight;
smallPlatformWidth = GameSettings.SmallPlatformWidth;
}
示例15: Awake
// Use this for initialization
void Awake()
{
floor = GameObject.Find ("Foreground");
spawner = GameObject.Find ("Spawner").GetComponent<Spawner>();
timeManager = GetComponent<TimeManager> ();
print ("Hey");
print (timeManager);
}