Example #1
0
    public void launchMeteor()
    {
        GameObject    newMetoer     = Instantiate(meteor, Vector3.zero, Quaternion.identity);
        pathGenerator randomPathGen = possibleMeteorPaths[UnityEngine.Random.Range(0, possibleMeteorPaths.Count)];

        newMetoer.GetComponent <meteorMovementManager>().intitialize(randomPathGen);
    }
Example #2
0
 //This should be called immediately upon instantiation
 public void intitialize(pathGenerator pathGen)
 {
     setUpRockRotation();
     follower = GetComponent <pathFollower>();
     follower.setPath(pathGen.bezierPath);
     originalSpeed = follower.speed;
     damager       = GetComponent <meteorDamager>();
 }
Example #3
0
    private void fireBullet()
    {
        pathGenerator gen = pathGens[Random.Range(0, pathGens.Count)];

        Instantiate(releasePS, gen.transform.position, Quaternion.identity);
        GameObject madeBullet = Instantiate(bullet, gen.transform.position, Quaternion.identity);

        madeBullet.GetComponent <pathFollower>().setPath(gen.bezierPath);
        bulletStreakCounter.signalBulletLaunch(madeBullet);
    }