Inheritance: MonoBehaviour
コード例 #1
0
 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 ());
    }
コード例 #4
0
 // 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
ファイル: BFGIManager.cs プロジェクト: Asderek/Projeto-Final
 /******************************************
  *
  * 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);
    }
コード例 #9
0
    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 == "");
 }
コード例 #12
0
 //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
ファイル: UIManagerScript.cs プロジェクト: ArtiDi/PinBall2D
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        UnpauseGame();
    }
コード例 #16
0
 // 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>();
 }
コード例 #17
0
    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);
    }
コード例 #20
0
    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);
     }
 }
コード例 #22
0
 private void Awake()
 {
     if (Singleton != null)
     {
         Destroy(gameObject);
     }
     else
     {
         Singleton = this;
     }
 }
コード例 #23
0
    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);
     }
 }
コード例 #25
0
 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);
    }
コード例 #32
0
    // 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
ファイル: RobotScript.cs プロジェクト: lutrampal/ProjetVR
    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();
        }
    }
コード例 #36
0
 // Use this for initialization
 void Start()
 {
     uiscript = GameObject.Find ("UIManager").GetComponent<UIManagerScript> ();
 }
コード例 #37
0
 void Awake()
 {
     addOre = GameObject.Find("UIManager");
     uiscript = addOre.GetComponent<UIManagerScript> ();
 }