/* * Adds Spike */ private void AddSpike() { GameObject c = (GameObject)Instantiate(spikePrefab); _child = c.GetComponent <Spike>(); _child.init(_currentLane, _swirlie, this); _head.NumOfSpikes++; }
/* * Spawns Swirlie on same lane as spike */ public override void spawn(Lane spawnLane) { _heightOffset = renderer.bounds.size.y / 2.0f; _shootTime = Time.time; _currentLane = spawnLane; _alive = true; gameObject.transform.position = _currentLane.Back + (renderer.bounds.size.y / 2) * _currentLane.Normal; transform.rotation = Quaternion.LookRotation(_currentLane.Normal); GameObject spike = (GameObject)Instantiate(spikePrefab); _headSpike = spike.GetComponent<Spike>(); _headSpike.init(spawnLane, this); }
/* * Spawns Swirlie on same lane as spike */ public override void spawn(Lane spawnLane) { _heightOffset = renderer.bounds.size.y / 2.0f; _shootTime = Time.time; _currentLane = spawnLane; _alive = true; gameObject.transform.position = _currentLane.Back + (renderer.bounds.size.y / 2) * _currentLane.Normal; transform.rotation = Quaternion.LookRotation(_currentLane.Normal); GameObject spike = (GameObject)Instantiate(spikePrefab); _headSpike = spike.GetComponent <Spike>(); _headSpike.init(spawnLane, this); }
/* * Adds Spike */ private void AddSpike() { GameObject c = (GameObject)Instantiate(spikePrefab); _child = c.GetComponent<Spike>(); _child.init(_currentLane,_swirlie,this); _head.NumOfSpikes++; }