SetActive() public static method

public static SetActive ( string name, bool b ) : void
name string
b bool
return void
Exemplo n.º 1
0
    public void OnClick()
    {
        Debug.Log("Button click!");
        gameObject.SetActive(false);

        MyCanvas.SetActive("Button2", true);
    }
Exemplo n.º 2
0
    /// ボタンをクリックした時の処理
    public void OnClick()
    {
        //Debug.Log("Button click!");

        //c = 1;

        // 非表示にする
        //gameObject.SetActive(false);

        // 自分自身を無効化する
        MyCanvas.SetInteractive("Button", false);

        //Cubeを非表示
        MyCanvas.SetActive("unitychan", false);
        MyCanvas.SetActive("robo", false);

        //taichiの表示
        MyCanvas.SetActive("taichi", true);



        // Button2を表示する
        //MyCanvas.SetActive("Button2", true);

        //Button2の有効化
        MyCanvas.SetInteractive("Button2", true);
        MyCanvas.SetInteractive("Button3", true);
    }
Exemplo n.º 3
0
    public void Onclick_DeliQCheck()
    {
        doAnimation = GameObject.Find("DOAnimation").GetComponent <DOAnimation>();
        string     visScroll = visibleMenuUI.GetVisibleMenu() + "/BG/Scroll View/Viewport/Content";
        GameObject content   = GameObject.Find(visScroll);
        int        cnt       = 0;

        // 入力個数の確認
        for (int i = 0; i < content.transform.childCount; i++)
        {
            deliNodeText = content.transform.GetChild(i).GetComponentsInChildren <Text>();
            cnt         += int.Parse(deliNodeText[1].text);
        }

        if (cnt == 0)
        {
            MyCanvas.SetActive("MenuUI/Warning", true);
            GameObject.Find("Warning").GetComponent <MessageView>().ItemDerivery_Warning();
            doAnimation.Open_DOScale(GameObject.Find("Warning/BG"));
        }
        else
        {
            MyCanvas.SetActive("MenuUI/Confirmation", true);
            GameObject.Find("Confirmation").GetComponent <ConfirmationView>().Deli_Confimation();
            doAnimation.Open_DOScale(GameObject.Find("Confirmation/BG"));
        }
    }
Exemplo n.º 4
0
 private void SaveConf()
 {
     //LoadData.DataSave();
     MyCanvas.SetActive("MenuUI/Success", true);
     GameObject.Find("Success").GetComponent <MessageView>().Save_Success();
     doAnimation.Open_DOScale(GameObject.Find("Success/BG"));
 }
Exemplo n.º 5
0
 /// アップグレードボタンの表示・非表示を切り替え
 void SetActiveUpgrade(bool b)
 {
     // 各種ボタンの表示制御
     MyCanvas.SetActive("ButtonRange", b);
     MyCanvas.SetActive("ButtonFirerate", b);
     MyCanvas.SetActive("ButtonPower", b);
 }
Exemplo n.º 6
0
 private void DeliConf()
 {
     GameObject.Find("Delivery/ConfBtn").GetComponent <DeliNodeBtn>().ItemDelivery();
     MyCanvas.SetActive("MenuUI/DeliSuccess", true);
     GameObject.Find("DeliSuccess").GetComponent <MessageView>().ItemDelivery_Success();
     doAnimation.Open_DOScale(GameObject.Find("DeliSuccess/BG"));
 }
Exemplo n.º 7
0
    //public static int c=2;

    public void SaveText()
    {
        str             = inputField.text;
        text.text       = str;
        inputField.text = "";
        MyCanvas.SetActive("word", true);
    }
Exemplo n.º 8
0
    public void OnClick()
    {
        gameObject.SetActive(false);

        MyCanvas.SetActive("Button2", true);
        ButtonFlag = true;
    }
Exemplo n.º 9
0
    /// 更新
    //	public void Update()
    public void Update(GameMgr.eSelMode selMode, Tower tower)
    {
        // Wave数を更新
        _txtWave.SetLabelFormat("Wave: {0}", Global.Wave);
        _txtMoney.SetLabelFormat("Money: ${0}", Global.Money);

        if (tower == null)
        {
            return;
        }


        _txtCost.Label = "";
        if (selMode == GameMgr.eSelMode.Buy)
        {
            // 購入モードのみテキストを設定する
            //_txtCost.SetLabelFormat("(cost ${0})", cost);
        }

        if (selMode == GameMgr.eSelMode.Upgrade)
        {
            // 選択しているタワーの情報を表示する
            _textTowerInfo.SetLabelFormat(
                "<<Tower Info>>\n  Range: Lv{0}\n  Firerate: Lv{1}\n  Power: Lv{2}",
                tower.LvRange,
                tower.LvFirerate,
                tower.LvPower
                );
        }

        // アップグレードボタン更新
        int money = Global.Money;

        // 射程範囲
        _btnRange.Enabled = (money >= tower.CostRange);
        _btnRange.FormatLabel("Range (${0})", tower.CostRange);
        // 連射速度
        _btnFirerate.Enabled = (money >= tower.CostFirerate);
        _btnFirerate.FormatLabel("Firerate (${0})", tower.CostFirerate);
        // 攻撃威力
        _btnPower.Enabled = (money >= tower.CostPower);
        _btnPower.FormatLabel("Power (${0})", tower.CostPower);



        // 生産コストを取得する
        int cost = Cost.TowerProduction();

        // 購入ボタンを押せるかどうかチェック
        _btnBuy.Enabled = (Global.Money >= cost);
        // 購入コストを表示する
        _btnBuy.FormatLabel("Buy (${0})", cost);
        // ライフ表示
        for (int i = 0; i < Global.LIFE_MAX; i++)
        {
            bool b = (Global.Life > i);
            MyCanvas.SetActive("ImageLife" + i, b);
        }
    }
Exemplo n.º 10
0
 public void OnClick_Save()
 {
     MyCanvas.SetActive("MenuUI/Confirmation", true);
     visibleMenuUI.SetVisibleMenu("MenuUI/Save");
     GameObject.Find("Confirmation").GetComponent <ConfirmationView>().Save_Confimation();
     doAnimation.Open_DOScale(GameObject.Find("Confirmation/BG"));
     //LoadData.DataSave();
 }
Exemplo n.º 11
0
    /// ボタンをクリックした時の処理
    public void OnClickFight()
    {
        Debug.Log("Fight click!");

        //通常攻撃と防御のボタンをアクティブにする
        MyCanvas.SetActive("Attack");
        MyCanvas.SetActive("Diffense");
    }
Exemplo n.º 12
0
 public void cancelClick()
 {
     Debug.Log("CancelButton click!");
     // 非表示にする
     MyCanvas.SetActive("CancelButon", false);
     MyCanvas.SetActive("PutDownButton", false);
     gameObject.SetActive(false);
 }
Exemplo n.º 13
0
 public void OnClick()
 {
     Debug.Log("Button click!");
     // 非表示にする
     gameObject.SetActive(false);
     // Button2を表示する(※ここを追加)
     MyCanvas.SetActive("Button2", true);
 }
Exemplo n.º 14
0
    public void OnClick_Close()
    {
        doAnimation = GameObject.Find("DOAnimation").GetComponent <DOAnimation>();
        doAnimation.Close_DOScale(GameObject.Find("ItemsProd/BG"));
        prodView = GameObject.Find("ItemsProd").GetComponent <ProdView>();
        prodView.ViewerClose();

        MyCanvas.SetActive("MenuUI/ItemsProd", false);
    }
Exemplo n.º 15
0
    void Update()
    {
        // GUIを更新
        _gui.Update(_selMode, _selTower);

        // カーソルを更新
        _cursor.Proc(_lCollision);

        switch (_state)
        {
        case eState.Wait:
            // Wave開始
            _tWait -= Time.deltaTime;
            if (_tWait < 0)
            {
                _enemyGenerator.Start();
                // Wave開始演出を呼び出す
                _waveStart.Begin(Global.Wave);
                // メイン状態に遷移する
                _state = eState.Main;
            }
            break;

        case eState.Main:
            // メインの更新
            UpdateMain();

            // ゲームオーバーチェック
            if (Global.Life <= 0)
            {
                _state = eState.Gameover;
                MyCanvas.SetActive("TextGameover", true);
                break;
            }

            // Waveクリアチェック
            if (IsWaveClear())
            {
                // 次のWaveへ
                Global.NextWave();
                // 停止タイマー設定
                _tWait = TIMER_WAIT;
                _state = eState.Wait;
            }

            break;

        case eState.Gameover:
            if (Input.GetMouseButton(0))
            {
                // やり直し
                SceneManager.LoadScene("Main");
            }
            break;
        }
    }
Exemplo n.º 16
0
    public void DisplayGameOver()
    {
        MyCanvas canvas = GameObject.FindGameObjectWithTag("Canvas").GetComponent <MyCanvas>();

        Debug.Log("TBcount::" + canvas.TBcount.ToString());
        for (int tbNum = canvas.TBcount; tbNum > 0; tbNum--)
        {
            canvas.SetActive("TB" + tbNum.ToString(), true);
        }
    }
Exemplo n.º 17
0
    private void VisProdlView()
    {
        nodeText    = this.GetComponentInChildren <Text>();
        doAnimation = GameObject.Find("DOAnimation").GetComponent <DOAnimation>();
        MyCanvas.SetActive("MenuUI/ItemsProd", true);
        prodView = GameObject.Find("ItemsProd").GetComponent <ProdView>();
        prodView.RecipeDetail(nodeText.text);

        doAnimation.Open_DOScale(GameObject.Find("ItemsProd/BG"));
    }
Exemplo n.º 18
0
 public void OnClick()
 {
     Debug.Log("Button3 click!");
     // 非表示にする
     gameObject.SetActive(false);
     MyCanvas.SetActive("VRButton", false);
     MyCanvas.SetActive("sofaButton", true);
     // Button2を表示する(※ここを追加)
     // MyCanvas.SetActive("Button2", true);
     // MyCanvas.SetActive("Button3", true);
 }
Exemplo n.º 19
0
 public void OnClick()
 {
     Debug.Log("Button2 click!");
     // 非表示にする
     gameObject.SetActive(false);
     MyCanvas.SetActive("Button3", false);
     SceneManager.ChangeMode();
     // Button2を表示する(※ここを追加)
     // MyCanvas.SetActive("Button2", true);
     // MyCanvas.SetActive("Button3", true);
 }
Exemplo n.º 20
0
    public void OnClick_Delivery()
    {
        MyCanvas.SetActive("MenuUI/Main", false);
        MyCanvas.SetActive("MenuUI/Delivery", true);
        returnEndBtn      = GameObject.Find("ReturnEndBtn").GetComponentInChildren <Text>();
        returnEndBtn.text = "戻る";
        visibleMenuUI.SetVisibleMenu("MenuUI/Delivery");
        GameObject.Find("Content").GetComponent <ScrollControll>().DeliveryScroll();

        doAnimation.Open_DOFade(GameObject.Find("Delivery/BG"));
    }
Exemplo n.º 21
0
 public void OnClick()
 {
     Debug.Log("sofaButton click!");
     // 非表示にする
     gameObject.SetActive(false);
     // MyCanvas.SetActive("Button3", true);
     sofa.SetActive(true);
     // Button2を表示する(※ここを追加)
     MyCanvas.SetActive("PutDownButton", true);
     MyCanvas.SetActive("CancelButon", true);
 }
Exemplo n.º 22
0
    public void OnClick_ItemProd()
    {
        prodView = GameObject.Find("ItemsProd").GetComponent <ProdView>();
        prodView.ItemProd();

        MyCanvas.SetActive("MenuUI/Success", true);
        successView = GameObject.Find("Success").GetComponent <MessageView>();
        doAnimation = GameObject.Find("DOAnimation").GetComponent <DOAnimation>();
        successView.ItemProd_Success();

        doAnimation.Open_DOScale(GameObject.Find("Success/BG"));
    }
Exemplo n.º 23
0
    // Use this for initialization
    void Start()
    {
        // 採集ボタンを非表示にする
        MyCanvas.SetActive("MiningBtn", false);
        // 採集アイテムを持ち物に追加する
        playerBag = GameObject.Find("PlayerItemManager").GetComponent <PlayerItemManager>();
        //
        player = GameObject.Find("mkmk_Preußen").GetComponent <PlayerMoveController>();

        // 各辞書の初期化
        InitializeDicts();
    }
Exemplo n.º 24
0
    IEnumerator GoMenuFade()
    {
        FadeInOut.fadeSpeed = 0.05f;
        FadeInOut.FadeOutInstruction();
        yield return(new WaitForSeconds(0.8f));

        MyCanvas.SetActive("MenuUI", true);
        FadeInOut.FadeInInstruction();
        yield return(new WaitForSeconds(1.0f));

        //returnEndBtn = GameObject.Find("ReturnEndBtn").GetComponentInChildren<Text>();
        Time.timeScale = 0f;
    }
Exemplo n.º 25
0
    void Start()
    {
        // Canvasコンポーネントを保持
        _canvas = GetComponent <Canvas>();
        MyCanvas.SetActive("Panel", false);
        MyCanvas.SetActive("unitychan", false);
        MyCanvas.SetActive("taichi", false);
        MyCanvas.SetActive("robo", false);

        MyCanvas.SetActive("InputField", false);
        MyCanvas.SetActive("send", false);
        MyCanvas.SetActive("word", false);
        MyCanvas.SetActive("Image", false);
    }
Exemplo n.º 26
0
    IEnumerator GoFieldFade()
    {
        Debug.Log(visibleMenuUI.GetVisibleMenu());
        FadeInOut.fadeSpeed = 0.05f;
        FadeInOut.FadeOutInstruction();
        yield return(new WaitForSeconds(0.9f));

        MyCanvas.SetActive("MenuUI", false);
        FadeInOut.FadeInInstruction();
        yield return(new WaitForSeconds(0.9f));

        //returnEndBtn = GameObject.Find("ReturnEndBtn").GetComponentInChildren<Text>();
        Time.timeScale = 1f;
    }
Exemplo n.º 27
0
    public void Onlick_Yes()
    {
        visibleMenuUI = GameObject.Find("FieldUI").GetComponent <MyCanvas>();
        doAnimation   = GameObject.Find("DOAnimation").GetComponent <DOAnimation>();
        MyCanvas.SetActive("MenuUI/Confirmation", false);

        if (visibleMenuUI.GetVisibleMenu().Equals("MenuUI/Delivery"))
        {
            DeliConf();
        }
        else if (visibleMenuUI.GetVisibleMenu().Equals("MenuUI/Save"))
        {
            SaveConf();
        }
    }
Exemplo n.º 28
0
    /// 更新
    public void Update2(GameMgr.eSelMode2 selMode2, Tower2 tower2)
    {
        // Wave数を更新
        _txtWave.SetLabelFormat("Wave: {0}", Global.Wave);
        _txtMoney2.SetLabelFormat("MP: {0}", Global.Money2);
        // 生産コストを取得する
        int cost = Cost.TowerProduction2();

        _txtCost2.Label = "";
        if (selMode2 == GameMgr.eSelMode2.Buy)
        {
            // 購入モードのみテキストを設定する
            _txtCost2.SetLabelFormat("(消費 {0})", cost);
        }
        // 購入ボタンを押せるかどうかチェック
        _btnBuy2.Enabled = (Global.Money2 >= cost);
        // 購入コストを表示する
        _btnBuy2.FormatLabel("呼び出す ({0})", cost);
        // ライフ表示
        for (int i = 0; i < Global.LIFE_MAX; i++)
        {
            bool b = (Global.Life2 > i);
            MyCanvas.SetActive("ImageLife2" + i, b);
        }

        if (selMode2 == GameMgr.eSelMode2.Upgrade)
        {
            // 選択しているタワーの情報を表示する
            _txtTowerInfo2.SetLabelFormat(
                "<<情報>>\n  範囲: Lv{0}\n  速度: Lv{1}\n  威力: Lv{2}",
                tower2.LvRange,
                tower2.LvFirerate,
                tower2.LvPower
                );

            // アップグレードボタン更新
            int money2 = Global.Money2;
            // 射程範囲
            _btnRange2.Enabled = (money2 >= tower2.CostRange);
            _btnRange2.FormatLabel("範囲 (${0})", tower2.CostRange);
            // 連射速度
            _btnFirerate2.Enabled = (money2 >= tower2.CostFirerate);
            _btnFirerate2.FormatLabel("速度 (${0})", tower2.CostFirerate);
            // 攻撃威力
            _btnPower2.Enabled = (money2 >= tower2.CostPower);
            _btnPower2.FormatLabel("威力 (${0})", tower2.CostPower);
        }
    }
Exemplo n.º 29
0
    public void OnClick()
    {
        // 自分自身を無効化する
        MyCanvas.SetInteractive("ButtonCharacter", false);

        MyCanvas.SetActive("Panel", true);



        // Buttonを表示する
        //MyCanvas.SetActive("Button", true);

        //Buttonを有効化
        MyCanvas.SetInteractive("Button", true);
        MyCanvas.SetInteractive("Button3", true);
    }
Exemplo n.º 30
0
    public void putDown()
    {
        Debug.Log("putdownButton click!");
        // 非表示にする
        MyCanvas.SetActive("CancelButon", false);
        MyCanvas.SetActive("PutDownButton", false);

        Vector3 pos = transform.position;

        //pos.y = -0.8f;
        for (int i = 0; i < 5; i++)
        {
            toggle_instance = Instantiate(homestuffPrefab, pos, transform.rotation);
            list_toggle_.Add(toggle_instance);
        }
        gameObject.SetActive(false);
    }