Esempio n. 1
0
    /*
     * Adds Spike
     */
    private void AddSpike()
    {
        GameObject c = (GameObject)Instantiate(spikePrefab);

        _child = c.GetComponent <Spike>();
        _child.init(_currentLane, _swirlie, this);
        _head.NumOfSpikes++;
    }
Esempio n. 2
0
 /*
  * 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);
 }
Esempio n. 3
0
    /*
     * 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);
    }
Esempio n. 4
0
 /*
  * Adds Spike
  */
 private void AddSpike()
 {
     GameObject c = (GameObject)Instantiate(spikePrefab);
     _child = c.GetComponent<Spike>();
     _child.init(_currentLane,_swirlie,this);
     _head.NumOfSpikes++;
 }