예제 #1
0
 private void Awake()
 {
     Set         = GameObject.Find("Set");
     surprise    = GameObject.Find("!");
     CS          = GetComponent <CameraShake>();
     ItemSM      = GameObject.Find("ItemSpawn").GetComponent <ItemSpawnManager>();
     TimeManager = GetComponent <TimeManager>();
 }
예제 #2
0
 /// <summary>
 /// Returns the SpawnManager
 /// </summary>
 public ItemSpawnManager GetItemSpawnManager()
 {
     if (itemSpawnManager == null)
     {
         itemSpawnManager = GetComponent <ItemSpawnManager>();
     }
     return(itemSpawnManager);
 }
예제 #3
0
    void Start()
    {
        soundManager = GameObject.Find("SoundManager").GetComponent <SoundManager>();

        if (SceneManager.GetActiveScene().name == "Main")
        {
            main   = GameObject.Find("Main");
            select = GameObject.Find("Select");
            credit = GameObject.Find("Credit");

            logo = GameObject.Find("Logo");

            select.SetActive(false);
            credit.SetActive(false);

            StartCoroutine(ShakeLogo());
        }
        if (SceneManager.GetActiveScene().name == "GameScene")
        {
            generator = GameObject.Find("TileMapManager").GetComponent <TitleMapGenerator>();
            spawner   = GameObject.FindGameObjectWithTag("StageArea").GetComponent <ItemSpawnManager>();
            textTimer = GameObject.Find("TextTimer").GetComponent <Text>();

            imageCountdown = GameObject.Find("ImageCountdown").GetComponent <Image>();

            generator.SetControlable(false);
            StartCoroutine(Countdown());

            imageTimerOver         = GameObject.Find("ImageTimerOver").GetComponent <Image>();
            imageTimerOver.enabled = false;

            GameObject resultAlpha = GameObject.Find("BackgroundAlpha");

            imageCountdown = GameObject.Find("ImageCountdown").GetComponent <Image>();

            imagePlayer = GameObject.Find("ImagePlayer").GetComponent <Image>();

            for (int i = 0; i < 4; i++)
            {
                gauge[i] = new Gauge();

                gauge[i].obj         = GameObject.Find("Gauge" + (i + 1));
                gauge[i].textPercent = gauge[i].obj.transform.Find("TextPercent").GetComponent <Text>();
            }

            result      = GameObject.Find("Result");
            panelResult = GameObject.Find("PanelResult");

            for (int i = 0; i < 4; i++)
            {
                resultPlayer[i] = panelResult.transform.Find("Player" + (i + 1)).gameObject;
                resultPlayer[i].transform.SetParent(GameObject.Find("Result").transform.Find("Hide"));
            }

            panelResult.SetActive(false);
            result.SetActive(false);
        }
    }
    //public float probability;// de 0.1 a 1
    //public GameObject playerExplosion;
    // Use this for initialization
    void Start()
    {
        GameObject lvlManagerObj = GameObject.FindGameObjectWithTag ("GameController");
        manager = lvlManagerObj.GetComponent<LevelManager> (); //habilitar y deshabilitar

        //item spawner
        GameObject itemManagerObj = GameObject.FindGameObjectWithTag("ItemManager");
        itemManager = itemManagerObj.GetComponent<ItemSpawnManager> ();
    }
예제 #5
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
예제 #6
0
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == "Scrap" && other.transform.parent != transform)
     {
         scraps.Add(other.gameObject);
         other.transform.parent = transform;
         var scrap = other.transform.GetComponent <Scrap>();
         scrap?.StopFollowing();
         scrap?.StartRotatingAroundPlayer();
         ItemSpawnManager.PickUpScrap(scrap);
         ScrapCount++;
         Debug.Log(ScrapCount);
     }
 }
예제 #7
0
    private void GameManagerActive()
    {
        Debug.Log("Active scene: " + SceneManager.GetActiveScene().buildIndex);
        gameManager      = GameObject.Find("GameManager").GetComponent <GameManager>();
        itemSpawnManager = GameObject.Find("GameManager").GetComponent <ItemSpawnManager>();
        camera           = GameObject.Find("Main Camera");
        camera.GetComponent <SimpleCameraController>().enabled = false;
        camera.transform.position = new Vector3(transform.position.x, 8, transform.position.z - 2);
        camera.transform.LookAt(transform);

        if (hasAuthority)
        {
            StartCoroutine(ListenForInput());
        }
    }
예제 #8
0
    // Start is called before the first frame update
    void Start()
    {
        gui_day = go_gui_day.GetComponent <TextMeshProUGUI>();

        sc_aura     = go_aura.GetComponent <AuraDetection>();
        sc_pc       = go_player.GetComponent <PlayerController_Sonic3>();
        sc_pool     = GetComponent <ObjectPooler>();
        sc_list     = GetComponent <ShoppingListManager>();
        sc_spawn    = GetComponent <ItemSpawnManager>();
        sc_customer = GetComponent <CustomerManager>();
        sc_grab     = GetComponent <GrabManager>();

        go_canvas.SetActive(true);

        sc_pool.FillPool();

        SetMenu(MenuState.Start);
    }
예제 #9
0
    private void SpawnItems()
    {
        MazeGenerator mazeGenerator = GameObject.Find("MazeGenerator(Clone)").GetComponent <MazeGenerator>();

        ItemSpawnManager itemSpawnManager = GetComponent <ItemSpawnManager>();

        Vector3 spawnPosition;

        for (int itemIndex = 0; itemIndex < 10; itemIndex++)
        {
            spawnPosition = mazeGenerator.GetUnusedSpawnPoint();
            itemSpawnManager.SpawnItem(spawnPosition);
        }

        for (int itemIndex = 0; itemIndex < 5; itemIndex++)
        {
            spawnPosition  = mazeGenerator.GetUnusedSpawnPoint();
            spawnPosition += Vector3.up * 0.6f;
            itemSpawnManager.SpawnAdvancedPistol(spawnPosition);
        }
    }
예제 #10
0
    public static ItemSpawnManager instance;//statyczne

    private void Start()
    {
        instance = this;
    }
예제 #11
0
 void Start()
 {
     itemSpawnManger = GameObject.Find("GameManager").GetComponent <ItemSpawnManager> ();
     score           = 0;
 }
 private void Awake()
 {
     instance = this;
 }
예제 #13
0
    // Start is called before the first frame update
    void Awake()
    {
        sc_aisles = GetComponent <ItemSpawnManager>();

        spawnedCustomers = new List <CustomerInfo>();
    }