상속: MonoBehaviour
 void Awake()
 {
     if (current == null)
     {
         current = this;
     }
 }
예제 #2
0
 // Start is called before the first frame update
 void Start()
 {
     uiman       = FindObjectOfType <UIManagerScript>().GetComponent <UIManagerScript>();
     dg          = FindObjectOfType <DogGenerator>().GetComponent <DogGenerator>();
     cuemanager  = FindObjectOfType <QueueManager>();
     currentTime = 0;
 }
예제 #3
0
    void Start()
    {
        minescript = GameObject.Find ("ClickBoxVein").GetComponent<Mine> ();
        uiscript = GameObject.Find ("UIManager").GetComponent<UIManagerScript> ();

        StartCoroutine (DeathTimer ());
    }
 // Use this for initialization
 void Start()
 {
     UIManager       = GameObject.Find("UI Manager");
     UIManagerScript = UIManager.GetComponent <UIManagerScript>();
     currentScore    = UIManagerScript.currentScoreValue;
     Score           = currentScore + 150;
 }
예제 #5
0
    private void Awake()
    {
        GameObject gameController = GameObject.FindGameObjectWithTag("GameController");

        waveManager = gameController.GetComponentInChildren <WaveManagerScript>();
        uIManager   = gameController.GetComponentInChildren <UIManagerScript>();
    }
예제 #6
0
 /******************************************
  *
  * public void Update()
  *		If the game is in the correct state, waits for the input of each player,
  *		and gets their answer for the BFGI questionnaire.
  *
  * Parameters
  *
  * Return
  *
  * ***************************************/
 public void Update()
 {
     if (GameManagerScript.GetInstance().currentStage == GameManagerScript.GameStage.BFGI)
     {
         foreach (Player p in players)
         {
             if (Input.GetButtonDown("Player" + p.playerID + "_X"))
             {
                 GameObject msg = UIManagerScript.GetInstance().CheckMsg(p.playerObj);
                 if (msg != null)
                 {
                     SituacaoScript script = msg.GetComponent <SituacaoScript>();
                     if (script != null)
                     {
                         p.answers.Add(script.value);
                         p.ready = true;
                         UIManagerScript.GetInstance().StopDisplayOnScreen(p.playerObj);
                         p.playerObj.SetActive(false);
                         LoadSituation(p.currentStage + 1);
                     }
                 }
             }
         }
     }
 }
예제 #7
0
 void Start()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
예제 #8
0
    void Start()
    {
        uiMan       = GetComponent <UIManagerScript>();
        personStats = GetComponent <Stats>();
        Debug.Log("new person spawned");
        // Debug.Log(gameObject.name + personStats.fancy);
        GetSubValues(personStats);

        // Debug.Log(allergyRating + " " + incomeRating + " " + spaceRating + " " + ageRating + " "+ energyRating + " " + familyRating + " " + petsRating);

        allergyText = SetStringCategory(allergyCategories, allergyRating);
        incomeText  = SetStringCategory(incomeCategories, incomeRating);
        spaceText   = SetStringCategory(spaceCategories, spaceRating);
        ageText     = SetStringCategory(ageCategories, ageRating);
        energyText  = SetStringCategory(energyCategories, energyRating);
        familyText  = SetStringCategory(familyCategories, familyRating);
        petsText    = SetStringCategory(petsCategories, petsRating);
        spriteIndex = Random.Range(0, 6);
        // Debug.Log(allergyText + " " + incomeText + " " + spaceText + " " + ageText + " " + energyText + " " + familyText + " " + petsText);
        if (PeopleGenerator.peopleQ.Count == 1)
        {
            //call UI manager to show player card with info.
            FindObjectOfType <UIManagerScript>().OnPersonUpdate();
        }

        FindObjectOfType <QueueManager>().AddToQueue(spriteIndex);
    }
    int GetCurrentMode()
    {
        // Needs code to obtain and return the currentMode from UIManagerScript
        UIManagerScript uIManagerScript = GetComponent <UIManagerScript>();
        int             mode            = uIManagerScript.currentMode;

        return(mode);
    }
예제 #10
0
    void Start()
    {
        isSoundON = true;
        isMusicON = true;

        DontDestroyOnLoad(this);
        Instance = this;
    }
예제 #11
0
 public void UpdateChoice()
 {
     // Fetch 3 choice by status
     currentCategory = GameObject.Find("BabyData").GetComponent <CSVReaderScript>().GetRandomGroup();
     UIManagerScript.SetChoice01(currentCategory.choices[0].message, currentCategory.choices[0].whyFail == "");
     UIManagerScript.SetChoice02(currentCategory.choices[1].message, currentCategory.choices[1].whyFail == "");
     UIManagerScript.SetChoice03(currentCategory.choices[2].message, currentCategory.choices[2].whyFail == "");
 }
 //distance to goal
 public void OnMoveCloser(float distance)
 {
     uiM = GameObject.Find("UIManager")?.GetComponent <UIManagerScript>();
     if (uiM != null)
     {
         uiM.filldistance(distance);
     }
 }
예제 #13
0
 private void CreateTerrain()
 {
     if (currentTerrain != null)
     {
         UIManagerScript.GetInstance().StopDisplayOnScreen(currentTerrain);
         Destroy(currentTerrain);
     }
     currentTerrain = Instantiate(terrain, new Vector3(0, 0, 0), Quaternion.identity);
 }
예제 #14
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     instance = this;
 }
예제 #15
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        UnpauseGame();
    }
 // Use this for initialization
 void Start()
 {
     spawnInterval      = 2;
     UIManager          = GameObject.Find("UI Manager");
     parentSpawn        = GameObject.Find("ParentSpawner");
     positionsParent    = parentSpawn.transform;
     spawnIntervalStart = spawnInterval;
     UIManagerScript    = UIManager.GetComponent <UIManagerScript>();
 }
    private void Awake()
    {
        levelManager = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren <LevelManagerScript>();
        uIManager    = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren <UIManagerScript>();

        mySpriteRenderer = GetComponent <SpriteRenderer>();
        canvas           = GetComponentInChildren <Canvas>().gameObject;

        isEmpty = true;
    }
예제 #18
0
 private void OnCollisionExit2D(Collision2D collision)
 {
     if (collision.collider.tag == "Enemies")
     {
         Debug.Log("AAA i hit " + collision.gameObject.tag); //this is working
         //Call game over when collision
         UIManagerScript script = UI.GetComponent <UIManagerScript>();
         StartCoroutine(script.GameOver());
     }
 }
예제 #19
0
    // Use this for initialization
    public void Start()
    {
        // Set reference to the builderScript
        builderScript    = GameObject.Find("BuildingManager").GetComponent <BuilderScript>();
        uiScript         = GameObject.Find("UIManager").GetComponent <UIManagerScript>();
        inputFieldScript = gameObject.GetComponent <InputField>();

        // Add a listener function to this object.
        // The onEndEdit listener has to have a string as its input parameter
        inputFieldScript.onEndEdit.AddListener(EnhancedOnEndEdit);
    }
    private void createListItem(Food f, int i)
    {
        //Instantiate the list item
        GameObject newListItem = Instantiate(sampleListItem) as GameObject;

        newListItem.transform.SetParent(foodMenuHolder.transform, false);
        Vector3 pos = sampleListItem.transform.localPosition;

        pos.y -= i * guiListItemOffset;
        newListItem.GetComponent <RectTransform>().localPosition = pos;

        //Setup attributes
        //View button
        Button viewButton = newListItem.gameObject.transform.Find("ViewBtn").GetComponent <Button>();

        viewButton.GetComponentInChildren <Text>().text = f.name;
        UIManagerScript uiManagerScript = UIManagerScript.GetComponent <UIManagerScript>();

        Debug.Log("Food list length: " + uiManagerScript.foodModels.Length);
        newListItem.gameObject.transform.Find("ViewBtn").GetComponent <Button>().onClick.AddListener(delegate { uiManagerScript.ViewModel(i - 1); });

        //set up spinner
        Debug.Log(f.name + " : " + f.var.Length);
        if (f.var != null)
        {
            if (f.var.Length > 1)
            {
                foreach (Variant v in f.var)
                {
                    newListItem.gameObject.transform.Find("VariantChooser").GetComponent <Dropdown>().options.Add(new Dropdown.OptionData(v.name));
                }
            }
            else
            {
                newListItem.gameObject.transform.Find("VariantChooser").gameObject.SetActive(false);
            }
        }
        else
        {
            newListItem.gameObject.transform.Find("VariantChooser").gameObject.SetActive(false);
        }

        //setup price
        newListItem.gameObject.transform.Find("PriceTxt").GetComponent <Text>().text = "₹" + f.var[0].price.ToString() + ".00";

        //setup script
        newListItem.GetComponent <FoodQtyScript>().databaseHandler = this;
        newListItem.GetComponent <FoodQtyScript>().foodItemId      = i - 1;
        newListItem.GetComponent <FoodQtyScript>().typeChoice      = newListItem.gameObject.transform.Find("VariantChooser").GetComponent <Dropdown>();
        newListItem.GetComponent <FoodQtyScript>().valText         = newListItem.gameObject.transform.Find("QtyPanel").Find("qtyTxt").GetComponent <Text>();


        newListItem.SetActive(true);
    }
예제 #21
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
 private void Awake()
 {
     if (Singleton != null)
     {
         Destroy(gameObject);
     }
     else
     {
         Singleton = this;
     }
 }
    private void Awake()
    {
        trapManager    = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren <TrapManagerScript>();
        levelManager   = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren <LevelManagerScript>();
        uIManager      = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren <UIManagerScript>();
        ballistaScript = GameObject.FindGameObjectWithTag("Player").GetComponent <BallistaScript>();

        price = trapManager.GetPrice(trapType);

        priceText.text = price.ToString();
    }
예제 #24
0
 private void Awake()
 {
     if (UIManagerInstance == null)
     {
         UIManagerInstance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
     }
 }
예제 #26
0
 void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         //  DontDestroyOnLoad(gameObject);
     }
 }
예제 #27
0
 private void Awake()
 {
     if (UIManager == null)
     {
         UIManager = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
예제 #28
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
예제 #29
0
    public void NeedToUpdate_Btn()
    {
        if (Input.GetKeyDown(KeyCode.F1))
        {
            InGameSetMenu();
        }

        if (Input.GetKeyDown(KeyCode.F2))
        {
            UIManagerScript.switch_Warehouse();
        }
    }
예제 #30
0
    private void Start()
    {
        gm = FindObjectOfType <GameStatusManager>().GetComponent <GameStatusManager>();

        uiManagerScript = FindObjectOfType <UIManagerScript>();

        Debug.Assert(peopleQ == null);
        peopleQ = new List <GameObject>();

        cuemanager = FindObjectOfType <QueueManager>();

        StartCoroutine("PersonSpawner");
    }
예제 #31
0
    /******************************************
     *
     * public void NewPlayer(int playerID)
     *		Creates a new player with a specified playerID value,
     *		signals the other managers to insert a new player on their player list,
     *		sets the BFGI questionnaire back to 1;
     *
     * Parameters
     *		int playerID - The number ID for the new player.
     * Return
     *
     * ***************************************/
    private void NewPlayer(int playerID)
    {
        GameObject newPlayer = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);

        newPlayer.name = "Player_" + playerID;
        newPlayer.GetComponent <PlayerMovementScript>().playerID = playerID;
        newPlayer.GetComponent <MeshRenderer>().material.color   = new Color32((byte)Random.Range(0, 255), (byte)Random.Range(0, 255), (byte)Random.Range(0, 255), 255);
        newPlayer.tag = GameManagerScript.Tags.Player.ToString();
        players.Add(newPlayer);

        BFGIManager.GetInstance().NewPlayer(newPlayer, playerID);
        PlayerBehaviourManager.GetInstance().NewPlayer(newPlayer, playerID);
        PlayerTypeManager.GetInstance().NewPlayer(newPlayer, playerID);
        UIManagerScript.GetInstance().StartDisplayOnScreen(newPlayer, "PlayerName_" + newPlayer.name, null);
    }
    // Use this for initialization
    void Start()
    {
        uiscript = GameObject.Find ("UIManager").GetComponent<UIManagerScript> ();

        wave = 4;
        startWave = true;
        spawnTime = 5;

        total = wave * spawnTime;

        randSpawnPosition = transform.position;

        enemyProximityMin = new Vector3(-40f, 0.0f, 2.5f);
        enemyProximityMax = new Vector3 (-40f, 0.0f, -22.5f);
    }
예제 #33
0
    // Use this for initialization
    void Start()
    {
        canRepair = false;
        blockT2 = false;
        gateT1 = false;

        addOre = GameObject.Find("UIManager");
        uiscript = addOre.GetComponent<UIManagerScript> ();

        getWallScript = GameObject.Find("WallCreationManager").GetComponent<WallCreation>();

        rend = GetComponent<Renderer>();
        rend.enabled = false;

        canPlace = false;
    }
예제 #34
0
    override protected void Start()
    {
        base.Start();

        levelScript = FindObjectOfType<LevelScript>();
        uiManager = FindObjectOfType<UIManagerScript>();

        ScriptRobot.Health = ScriptRobot.MaxHealth;

        (ScriptRobot.CharacterController as RobotController).AttackDelay = ScriptRobot.AttackDelay;
        (ScriptRobot.CharacterController as RobotController).JumpDelay = ScriptRobot.JumpDelay;

        characterShootingHeight = -0.1f;

        if (projectile)
        {
            projectile.ScriptProjectile = new Projectile(ScriptRobot.ShotsDamage, ScriptRobot.ShotsSpeed);
        }

        robotAnimator = GetComponent<Animator>();

    }
예제 #35
0
    void Start()
    {
        uiScript = GetComponent<UIManagerScript>();

        for (int i = 0; i < initLength; ++i)
        {
            EatFood();
        }
    }
 // Use this for initialization
 void Start()
 {
     uiscript = GameObject.Find ("UIManager").GetComponent<UIManagerScript> ();
 }
예제 #37
0
 void Awake()
 {
     addOre = GameObject.Find("UIManager");
     uiscript = addOre.GetComponent<UIManagerScript> ();
 }