• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UnityEngine.CanvasGroup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UnityEngine.CanvasGroup的典型用法代码示例。如果您正苦于以下问题:C# CanvasGroup类的具体用法?C# CanvasGroup怎么用?C# CanvasGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CanvasGroup类属于UnityEngine命名空间,在下文中一共展示了CanvasGroup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Start

	void Start () {

		mayUseHealth = false;
		mayUseMana = false;

		RectTransform slotRect = GetComponent<RectTransform> (); 
		RectTransform txtRect = stackTxt.GetComponent<RectTransform> (); 

		int txtScaleFactor = (int)(slotRect.sizeDelta.x * 0.55); 

		stackTxt.resizeTextMaxSize = txtScaleFactor; 
		stackTxt.resizeTextMinSize = txtScaleFactor; 

		txtRect.SetSizeWithCurrentAnchors (RectTransform.Axis.Horizontal, slotRect.sizeDelta.x); 
		txtRect.SetSizeWithCurrentAnchors (RectTransform.Axis.Vertical, slotRect.sizeDelta.y);

        if (transform.parent != null) {

            if (itemGroup == null) {
                itemGroup = transform.parent.GetComponent<CanvasGroup>();
            }
            EventTrigger trigger = GetComponentInParent<EventTrigger>();
            EventTrigger.Entry entry = new EventTrigger.Entry();
            entry.eventID = EventTriggerType.PointerEnter;
            entry.callback.AddListener((eventData) => { transform.parent.GetComponent<Inventory>().ShowToolTip(gameObject); });
            trigger.triggers.Add(entry);
        }
    }
开发者ID:Fahrettin52,项目名称:Game-Lab-1.1,代码行数:28,代码来源:Slot.cs


示例2: CallLoading

    public static void CallLoading(ModalPanel modalPanel, CanvasGroup canvasGroup, string messageText, UnityAction callback)
    {
        ShowModal (modalPanel, canvasGroup);

        modalPanel.loadingPanel.gameObject.SetActive (true);
        modalPanel.loadingPanel.Show (messageText, callback);
    }
开发者ID:rodsordi,项目名称:Gude,代码行数:7,代码来源:ModalPanel.cs


示例3: Start

 void Start()
 {
     _debugUI = GameObject.Find("DebugUI").GetComponent<DebugUI>();
     _text = gameObject.GetComponent<Text>();
     _canvasGroup = gameObject.GetComponent<CanvasGroup> ();
     _baseAlpha = 1f;
 }
开发者ID:EpicPants90,项目名称:ELB,代码行数:7,代码来源:DebugText.cs


示例4: Awake

    void Awake()
    {
        if (UI_Manager == null)
        {
            UI_Manager = this;
            
            DontDestroyOnLoad(gameObject);            
        }
        else if (UI_Manager != null)
        {
            Destroy(gameObject);
        }        

        _titleScreenAnim = titleScreen.GetComponent<Animator>();
        _soundScreenAnim = soundScreen.GetComponent<Animator>();
        _pauseScreenAnim = pauseScreen.GetComponent<Animator>();
        _loseScreenAnim = loseScreen.GetComponent<Animator>();
        _fadeScreenAnim = fadeScreen.GetComponent<Animator>();
        _oFScreenAnim = overlayFadeScreen.GetComponent<Animator>();

        _titleCanvas = titleScreen.GetComponent<CanvasGroup>();
        _pauseCanvas = pauseScreen.GetComponent<CanvasGroup>();
        _loseCanvas = loseScreen.GetComponent<CanvasGroup>();

        _source = GetComponent<AudioSource>();        

        Setup();
    }
开发者ID:Darylcxz,项目名称:GameJam2016,代码行数:28,代码来源:UIManager.cs


示例5: Awake

	void Awake() {
		// get components
		canvas = transform.GetComponent<CanvasGroup> ();
		// bind events
		_dispatcher.AddListener ("close_new_game_panel", hide);
		_dispatcher.AddListener ("open_new_game_panel", show);
	}
开发者ID:mengtest,项目名称:movieschallenge_client,代码行数:7,代码来源:NewGamePanelScript.cs


示例6: Awake

	void Awake () {
		// get elements
		panel = transform.GetComponent<CanvasGroup> ();
		// bind events
		_dispatcher.AddListener ("loading_interstitial_open", open);
		_dispatcher.AddListener ("loading_interstitial_close", close);
	}
开发者ID:mengtest,项目名称:movieschallenge_client,代码行数:7,代码来源:LoadingPanelScript.cs


示例7: Start

 //private PlayerController player;
 void Start()
 {
     //player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
     visibility = GetComponent<CanvasGroup>();
     visibility.alpha = 0;
     StartCoroutine( showUI());
 }
开发者ID:KeiranG19,项目名称:Straypunch-Studios,代码行数:8,代码来源:UImanager.cs


示例8: Awake

	public void Awake(){
		_animator = GetComponent<Animator> ();
		_canvasGroup = GetComponent<CanvasGroup> ();

		var rect = GetComponent<RectTransform> ();
		rect.offsetMax = rect.offsetMin = new Vector2 (0, 0);
	}
开发者ID:marcochiu2-c,项目名称:MainMenu_uFrame1.6,代码行数:7,代码来源:Menu.cs


示例9: FadeToGroupCoroutine

    private IEnumerator FadeToGroupCoroutine(CanvasGroup group, float duration)
    {
        // Prevent interaction with the first group.
        currentGroup.interactable = false;

        // Activate the next Group.
        group.gameObject.SetActive(true);

        float t = 0f;
        while (t < duration)
        {
            // Increase t in real time.
            t += Time.unscaledDeltaTime;

            // Fade current group out.
            currentGroup.alpha = Mathf.SmoothStep (1f, 0f, t);

            // Fade new group in.
            group.alpha = Mathf.SmoothStep (0f, 1f, t);

            yield return new WaitForEndOfFrame();
        }

        // Update previous and current Group tracking variables.
        previousGroup = currentGroup;
        currentGroup = group;

        // Deactivate the last Group.
        previousGroup.gameObject.SetActive(false);

        //Enable interaction.
        currentGroup.interactable = true;
    }
开发者ID:Abengoshis,项目名称:PlanetGame,代码行数:33,代码来源:CanvasGroupController.cs


示例10: BringToForefront

    public void BringToForefront(CanvasGroup panel)
    {
        panel.transform.SetAsLastSibling();

        panel.DOKill();
        panel.DOFade(1.0f, this.FadeInDuration).SetEase(this.FadeEase);
    }
开发者ID:jose-villegas,项目名称:GameJam16,代码行数:7,代码来源:MainMenuPresenter.cs


示例11: OnEnable

    void OnEnable()
    {
        _canvasGroup = GetComponent<CanvasGroup>();
        _image = GetComponent<Image>();

        LateUpdate();
    }
开发者ID:juliabax,项目名称:AulaUnity,代码行数:7,代码来源:AnimatedAlpha.cs


示例12: Start

    void Start()
    {
        instance = this;
        infoBar = GetComponent<CanvasGroup>();

        MWM_CMS_DatabaseManager.instance.apartmentManager.SelectedApartmentAction += HandleSelectedApartment;
    }
开发者ID:xinleng,项目名称:Scripts-FromStreatham,代码行数:7,代码来源:ApartmentInfoBar.cs


示例13: Awake

 void Awake()
 {
     PlayerPrefs.SetFloat("Difficulty", FindObjectOfType<Slider>().value);
     PlayerPrefs.SetInt("KilledBacterias", 0);
     _confirmQuitCanvasGroup = GameObject.Find("QuitPanel").GetComponent<CanvasGroup>();
     _uiCanvasGroup = GameObject.Find("MainMenu").GetComponent<CanvasGroup>();
 }
开发者ID:tpeet,项目名称:FightForLife,代码行数:7,代码来源:MenuController.cs


示例14: Start

 void Start()
 {
     minimap = GetComponent<RectTransform>();
     minimapGroup = GetComponent<CanvasGroup>();
     parentTransform = transform.parent.GetComponent<RectTransform>();
     eventer.OnPlayerJoined += OnPlayerJoined;
 }
开发者ID:Chaosed0,项目名称:foxstar,代码行数:7,代码来源:MinimapPositioner.cs


示例15: ShowPanel

 public void ShowPanel(CanvasGroup panel)
 {
     HideAll();
     panel.alpha = 1;
     panel.interactable = true;
     panel.blocksRaycasts = true;
 }
开发者ID:idaelDev,项目名称:Meditate-Em-Up-GGJ2016,代码行数:7,代码来源:MenuController.cs


示例16: Awake

 void Awake()
 {
     m_Rect = transform as RectTransform;
     m_group = GetComponent<CanvasGroup>();
     m_text = GetComponentInChildren<Text>();
     m_clickImage = GetComponentInChildren<Image>();
 }
开发者ID:BubbleRap,项目名称:ExploreTheDarkness,代码行数:7,代码来源:ButtonPromptCanvas.cs


示例17: Start

    void Start()
    {
        canvasGroup = (CanvasGroup)GetComponent(typeof(CanvasGroup));

        canvasGroup.alpha = 0.0f;

        fadeInStartTime = Time.unscaledTime;

        if (wastedClip != null)
            AudioCenter.PlayClipAtMainCamera(wastedClip);

        int newScore = (SceneObjects.Get().game.levelNumber - 1);

        resultTextView.text = "Сожжено волн: " + newScore;

        SceneObjects so = SceneObjects.Get();
        ScoreController sc = so.score;
        int maxScore = sc.maxScore;

        bestResultTextView.text = "Ваш прошлый рекорд: " + maxScore;

        Camera.main.GetComponent<AudioSource>().clip = null;

        SceneObjects.Get().score.AddScore(newScore);
    }
开发者ID:gorecode,项目名称:they-will-burn,代码行数:25,代码来源:GameOverUIController.cs


示例18: Start

    // Use this for initialization
    void Start()
    {
        instance = this;

        canvasGroup = GetComponent<CanvasGroup>();
        ApartmentManager.instance.FilterApartmentsAction +=	 HandleFilterApartmentsAction;
    }
开发者ID:xinleng,项目名称:Scripts-FromStreatham,代码行数:8,代码来源:ShowFloorPlate.cs


示例19: Update

    void Update()
    {
        if (background == null)
        {
            background = GameObject.Find("Background").GetComponent<Image>();
        }
        if (storyImage == null)
        {
            storyImage = GameObject.Find("StoryImage").GetComponent<Image>();
        }
        if (storyText == null)
        {
            storyText = GameObject.Find("StoryText").GetComponent<Text>();
        }
        if (pauseMenu == null)
        {
            pauseMenu = GameObject.Find("PauseMenu").GetComponent<CanvasGroup>();
        }



        if (activeState != null)
        {
            activeState.StateUpdate();
        }
    }
开发者ID:Iciraus,项目名称:Heroes-Path,代码行数:26,代码来源:GameStateManager.cs


示例20: UiAnimationFade

 public UiAnimationFade(GameObject gameobject, float duration, FadeType fadeType) : base(gameobject)
 {
     Canvas = gameobject.GetOrAddComponent<CanvasGroup>();
     Canvas.alpha = fadeType == FadeType.In ? 0f : Canvas.alpha;
     Duration = duration;
     Fade = fadeType;
 }
开发者ID:Trainfire,项目名称:Drawesome,代码行数:7,代码来源:UiAnimationFade.cs



注:本文中的UnityEngine.CanvasGroup类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UnityEngine.CanvasRenderer类代码示例发布时间:2022-05-26
下一篇:
C# UnityEngine.Canvas类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap