Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     LadderEnter       = false;
     monstersTemplates = GameObject.FindGameObjectWithTag("Monsters").GetComponent <MonsterTemplates> ();
     gvc = GameObject.Find("GlobalVariables").GetComponent <GlobalVariablesController> ();
     cs  = GameObject.Find("Player").GetComponent <CharacterStats> ();
 }
Beispiel #2
0
    void Start()
    {
        float y          = 0;
        float x          = 0;
        float spawnrand1 = Random.Range(0.1f, 0.3f); //Should help prevent the spawning doors next to walls due to simultaneous spawning

        switch (openingDirection)
        {
        case 1:
            Top = true;
            y   = (0.0313f * (transform.position.y + 4.5f)) + 3;
            x   = (0.0313f * (transform.position.x + 0)) + 5.5f;
            break;

        case 2:
            Bottom = true;
            y      = (0.0313f * (transform.position.y - 4.5f)) + 3;
            x      = (0.0313f * (transform.position.x + 0)) + 5.5f;
            break;

        case 4:
            Left = true;
            y    = (0.0313f * (transform.position.y + 0)) + 3;
            x    = (0.0313f * (transform.position.x - 8)) + 5.5f;
            break;

        case 8:
            Right = true;
            y     = (0.0313f * (transform.position.y + 0)) + 3;
            x     = (0.0313f * (transform.position.x + 8)) + 5.5f;
            break;
        }

        GameObject mapD = Instantiate(mapDoor, new Vector3(x, y, 0), Quaternion.identity);

        mapD.transform.SetParent(GameObject.FindGameObjectWithTag("MapGUI").transform, false);

        templates         = GameObject.FindGameObjectWithTag("Rooms").GetComponent <RoomTemplates> ();
        monstersTemplates = GameObject.FindGameObjectWithTag("Monsters").GetComponent <MonsterTemplates> ();
        Invoke("Spawn", spawnrand1);
    }
Beispiel #3
0
 // Start is called before the first frame update
 void Start()
 {
     notSpawned        = true;
     monstersTemplates = GameObject.FindGameObjectWithTag("Monsters").GetComponent <MonsterTemplates> ();
 }
Beispiel #4
0
 void Start()
 {
     //Physics2D.IgnoreLayerCollision (8, 9,true);
     monstersTemplates = GameObject.FindGameObjectWithTag("Monsters").GetComponent <MonsterTemplates> ();
 }