// Start is called before the first frame update
 void Start()
 {
     state       = PlayerState.IDLE;
     myRigibody  = GetComponent <Rigidbody>();
     mainCamera  = FindObjectOfType <Camera>();
     _gunSpawner = GameObject.FindGameObjectWithTag("Spawn").GetComponent <GunSpawner>();
 }
예제 #2
0
 public override void Grab(Transform hand)
 {
     base.Grab(hand);
     LevelManager.StartGame();
     if (spawner)
     {
         spawner.TakeWeapon();
         spawner = null;
     }
     explodeOnImpact = false;
 }
예제 #3
0
    public override void _Ready()
    {
        player      = GetNode <Player>("Player");
        enemiesNode = GetNode <Node2D>("Enemies");
        pauseMenue  = GetNode <Control>("Hud/PauseMenue");

        gunSpawner        = new GunSpawner();
        enemySpawner      = new EnemySpawner(enemiesNode);
        pointsSpawner     = new PointsSpawner(pointsScene);
        consumableSpawner = new ConsumableSpawner(healthPackScene, energyDrinkScene, GetTree().CurrentScene);

        gunSpawner.InitGun <Pistol>(ref pistol, pistolScene);
        gunSpawner.InitGun <Shotgun>(ref shotgun, shotGunScene);
        gunSpawner.InitGun <RocketLauncher>(ref rocketLauncher, rocketLauncherScene);

        SpawnGuns();
        SpawnEnemies();

        if (IsPaused)
        {
            ResumeGame();
        }
    }
    // Use this for initialization
    void Start()
    {
        coreBlinkAnimation = GetComponentInChildren <BlinkDamageAnimation> ();
        currentHealth      = maxHealth;
        difficulty         = 0;

        wanderBehavior = GetComponent <WanderBehavior> ();
        wanderBehavior.setActive(true);
        followBehavior = GetComponent <FollowBehavior> ();
        wanderBehavior.setActive(false);

        shieldSpawner  = GetComponentInChildren <ShieldSpawner> ();
        gunSpawner     = GetComponentInChildren <GunSpawner> ();
        wallGunSpawner = GetComponentInChildren <WallGunSpawner> ();
        targetFire     = GetComponent <TargettedFireBehavior> ();
        trapSpawner    = GetComponentInChildren <TrapSpawner> ();

        nextBehaviorStartTime = Time.time + behaviorDelay;
        nextBehaviorEndTime   = nextBehaviorStartTime + behaviorDuration;
//		targetFire.setStatus (true);
//		wallGunSpawner.setStatus (true);

        gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController> ();
    }
예제 #5
0
 public void Init(GunSpawner gs)
 {
     spawner = gs;
 }