Esempio n. 1
0
        /// <summary>
        /// Based on the round number, calculates the amount of SpawnControls that will be needed upon level start and how much to increment each.
        /// </summary>
        /// <param name="roundNumber"></param>
        /// <returns></returns>
        private LinkedList <SpawnControl> CalculateSpawnControllers(int roundNumber)
        {
            LinkedList <SpawnControl> list = new LinkedList <SpawnControl>();
            int amount;
            int increment;

            if (roundNumber < addControlEvery)
            {
                amount = 1;
            }
            else
            {
                amount = (roundNumber / addControlEvery) + 1;
            }
            increment = roundNumber;
            //increment = roundNumber % addControlEvery==0 ? 1:roundNumber%addControlEvery;
            Debug.Log("Amount: " + amount + " increment: " + increment);
            for (int i = 0; i < amount; i++)
            {
                int init = 0;
                if (i > waveSpawners.Count)
                {
                    init = i % maxEnemyTypes;
                }
                SpawnControl control = new SpawnControl(waveSpawners.Count, maxEnemyTypes, maxSpawnAmount, init);
                for (int j = 0; j < increment; j++)
                {
                    control.Increment();
                }
                list.AddLast(control);
            }
            return(list);
        }
Esempio n. 2
0
 void Awake()
 {
     gp       = GameObject.Find("GamePlay").GetComponent <GamePlay> ();
     ls       = GameObject.Find("LevelSounds").GetComponent <LevelSounds> ();
     spawnMax = GameObject.Find("SpawnMax").GetComponent <SpawnUp> ();
     spawnMin = GameObject.Find("SpawnMin").GetComponent <SpawnUp> ();
     spawnObj = GameObject.Find("SpawnControl").GetComponent <SpawnControl> ();
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     if (endlessMode == false)
     {
         trans = spawns[0].transform;
     }
     spawnControl = gameObject.GetComponent <SpawnControl> ();
 }
Esempio n. 4
0
 public static SpawnControl Instance()
 {
     if (_instance == null)
     {
         Debug.Log("SpawnControl: Instance is NULL. Run around in circles and panic.");
         _instance = new SpawnControl();
     }
     return _instance;
 }
Esempio n. 5
0
 public static SpawnControl Instance()
 {
     if (_instance == null)
     {
         Debug.Log("SpawnControl: Instance is NULL. Run around in circles and panic.");
         _instance = new SpawnControl();
     }
     return(_instance);
 }
    private void Start()
    {
        adenin   = GameObject.FindGameObjectWithTag("Adenin");
        thymine  = GameObject.FindGameObjectWithTag("thymine");
        cytosine = GameObject.FindGameObjectWithTag("cytosine");
        guanine  = GameObject.FindGameObjectWithTag("guanine");

        AreThereAnyNucleotides = FindObjectOfType <SpawnControl>().isObjectSpawned;

        sControl = FindObjectOfType <SpawnControl>();
    }
        public IPacketWithSize ReadPacket(IProtocolDataReader reader)
        {
            Flying          = (Flying)reader.ReadByte();
            NoClip          = (NoClip)reader.ReadByte();
            Speeding        = (Speeding)reader.ReadByte();
            SpawnControl    = (SpawnControl)reader.ReadByte();
            ThirdPersonView = (ThirdPersonView)reader.ReadByte();
            JumpHeight      = reader.ReadShort();

            return(this);
        }
        public IPacketWithSize ReadPacket(IMinecraftDataReader reader)
        {
            Flying = (Flying) reader.ReadByte();
            NoClip = (NoClip) reader.ReadByte();
            Speeding = (Speeding) reader.ReadByte();
            SpawnControl = (SpawnControl) reader.ReadByte();
            ThirdPersonView = (ThirdPersonView) reader.ReadByte();
            JumpHeight = reader.ReadShort();

            return this;
        }
Esempio n. 9
0
    // Use this for initialization
    protected virtual void Start()
    {
        //Load the position and map position
        LoadPos();

        if (pathFinder == null)
        {
            pathFinder = PathFinder.Instance();
        }

        if (spawnControl == null)
        {
            spawnControl = SpawnControl.Instance();
        }
        facing = Direction.DONTMOVE;
    }
Esempio n. 10
0
    // Use this for initialization
    protected virtual void Start()
    {
        //Load the position and map position
        LoadPos();

        //Set the animator
        animator = GetComponent <Animator> ();

        if (pathFinder == null)
        {
            pathFinder = PathFinder.Instance();
        }

        if (spawnControl == null)
        {
            spawnControl = SpawnControl.Instance();
        }
        facing = Direction.DONTMOVE;
    }
Esempio n. 11
0
    // Use this for initialization
    protected virtual void Start()
    {
        //Generate a random life span
        lifeSpan = Random.Range(3000, 4000);

        //Load the position and map position
        LoadPos();

        if (spawnControl == null)
        {
            spawnControl = SpawnControl.Instance();
        }

        if (pathFinder == null)
        {
            pathFinder = PathFinder.Instance();
        }

        //set initial scale to zero
        Vector3 scale = new Vector3(0, 0, 1f);
        //transform.localScale = scale;
    }
Esempio n. 12
0
 // Use this for initialization
 void Start()
 {
     Instantiate(seaMan);
     Instantiate(landMan);
     _instance = this;
 }
Esempio n. 13
0
 void Start()
 {
     sc = GameObject.Find("SpawnPoints").GetComponent <SpawnControl>();
 }
 void Start()
 {
     agent  = GetComponent <NavMeshAgent>();
     player = GameObject.Find("PlayerStandin");
     sc     = GameObject.Find("SpawnPoints").GetComponent <SpawnControl>();
 }
Esempio n. 15
0
 // Use this for initialization
 void Start()
 {
     gameState   = "waiting";
     custSpawner = GameObject.Find("Customer Spawn").GetComponent <SpawnControl>();
 }
Esempio n. 16
0
 // Use this for initialization
 void Start()
 {
     _instance = this;
 }
Esempio n. 17
0
    // Use this for initialization
    protected virtual void Start()
    {
        //Load the position and map position
        LoadPos();

        //Set the animator
        animator = GetComponent<Animator> ();

        if (pathFinder == null)
        {
            pathFinder = PathFinder.Instance();
        }

        if (spawnControl == null)
        {
            spawnControl = SpawnControl.Instance();
        }
        facing = Direction.DONTMOVE;
    }
Esempio n. 18
0
    // Use this for initialization
    protected virtual void Start()
    {
        //Generate a random life span
        lifeSpan = Random.Range(3000, 4000);

        //Load the position and map position
        LoadPos();

        if (spawnControl == null)
        {
            spawnControl = SpawnControl.Instance();
        }

        if (pathFinder == null)
        {
            pathFinder = PathFinder.Instance();
        }

        //set initial scale to zero
        Vector3 scale = new Vector3( 0, 0, 1f );
        //transform.localScale = scale;
    }
Esempio n. 19
0
 void Start()
 {
     spawnControl = GetComponent<SpawnControl> ();
 }
Esempio n. 20
0
 // Use this for initialization
 void Start()
 {
     spawn = FindObjectOfType <SpawnControl>();
 }
Esempio n. 21
0
 void Start()
 {
     lobby = GetComponent<Lobby> ();
     rom = GetComponent<Rom> ();
     spawnControl = GetComponent<SpawnControl> ();
 }
Esempio n. 22
0
 // Use this for initialization
 void Start()
 {
     _instance = this;
 }
Esempio n. 23
0
 void Start()
 {
     healthandscore = GameObject.Find("Gobel").GetComponent <HealthandScore>();
     SoundControl   = GameObject.Find("EnemyScript").GetComponent <SpawnControl>();
 }