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

C# UI.RawImage类代码示例

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

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



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

示例1: Awake

    void Awake()
    {
        logoState = LogoState.WaitFade;

        #if UNITY_EDITOR
            timerLength = 0f;
        #elif UNITY_ANDROID
            timerLength = 0f;
        #elif UNITY_IPHONE
            timerLength = 3.5f;
        #endif

        timer = 0;

        backgroundImage = GameObject.Find("Background").GetComponent<RawImage>();
        backgroundColor = backgroundImage.color;

        //backgroundImage.color = new Color(ba)

        logoImage = GameObject.Find("Logo").GetComponent<RawImage>();
        logoColor = logoImage.color;

        logoImage.color = new Color(logoColor.r, logoColor.g, logoColor.b, 0f);

        GameObject.Find("AdColonyAdManager").GetComponent<AdColonyManager>().Initialize();
    }
开发者ID:CovalentGaming,项目名称:Super-Dash,代码行数:26,代码来源:SplashScreen.cs


示例2: gaxb_init

    public override void gaxb_init()
    {
        gameObject = new GameObject ("<Movie/>", typeof(RectTransform));

        canvasRenderer = gameObject.AddComponent<CanvasRenderer> ();
        image = gameObject.AddComponent<RawImage> ();

        if (color != null) {
            image.color = color.Value;
        }

        if (resourcePath != null) {

            // Why, oh why are movie textures not supported in iOS?
            #if (UNITY_IOS || UNITY_ANDROID || UNITY_WEBGL)

            #else
            // Set texture
            MovieTexture tex = Resources.Load (resourcePath) as MovieTexture;
            if (tex != null) {
                image.texture = tex;

                tex.Play ();
                tex.loop = looping;
            }
            #endif

        }
    }
开发者ID:jun-nishikawa-grm,项目名称:PlanetUnity2,代码行数:29,代码来源:PUMovie.cs


示例3: Awake

    private void Awake()
    {
        slider = GetComponent<BoxSlider>();
        image = GetComponent<RawImage>();

        RegenerateSVTexture();
    }
开发者ID:assertivist,项目名称:vastan-unity,代码行数:7,代码来源:SVBoxSlider.cs


示例4: Start

 // Use this for initialization
 void Start()
 {
     if (this.AnyBladeModeElement)
     {
         this.BladeModeElementRawImage = this.AnyBladeModeElement.GetComponent<RawImage>();
     }
 }
开发者ID:clopaclopa,项目名称:TacoHell,代码行数:8,代码来源:CounterMirrorBladeModeVisibility.cs


示例5: Start

		// Use this for initialization
		protected void Start () {
			rectTransform = (RectTransform)this.GetComponent<RectTransform> ();
			rawImage = (RawImage) this.GetComponent<RawImage> ();
			Reset ();

			GetZoneInfos ();
		}
开发者ID:fromtons,项目名称:meme-pas-peur_app,代码行数:8,代码来源:DrawingZone.cs


示例6: Awake

    private void Awake()
    {
        var rectTransform = GetComponent<RectTransform>();
        var textureWidth = (int) rectTransform.rect.width;
        var textureHeight = (int) rectTransform.rect.height;

        var gradient = GameManager.Instance.StateColorDisplayRange;

        var stepCount = Settings.Instance.Amplitude * 2 + 1;

        texture = new Texture2D(textureWidth, textureHeight, TextureFormat.ARGB32, false, false);
        var colors = new Color[textureWidth * textureHeight];
        for (var x = 0; x < textureWidth; x++)
        {
            //var color = gradient.Evaluate(Mathf.Clamp((float) x / (textureWidth - 1), cutoffValues.From, cutoffValues.To));
            var t = (float) x / textureWidth;
            var color = gradient.Evaluate((Mathf.FloorToInt(t * stepCount) + 0.5f) / stepCount);
            for (var y = 0; y < textureHeight; y++)
            {
                colors[x + y * textureWidth] = color;
            }
        }

        texture.SetPixels(colors);
        texture.Apply();

        imageDisplay = GetComponent<RawImage>();
        imageDisplay.texture = texture;
    }
开发者ID:TobiasWehrum,项目名称:CH15-FruitFever,代码行数:29,代码来源:GradientDisplay.cs


示例7: placeBlockOnCell

	/**
	 * Places the selected block (from the menu) into the bottom or top layer of this cell.
	 * 
	 */
	public void placeBlockOnCell(RawImage rawImage)
	{
		if (blockIdBottom == 0) { // bottom block is empty

			blockIdBottom = Global.selectedBlockId;
			rawImage.texture = getTextureByBlockId (blockIdBottom);
			playBlockPlacedSound ();

		} else if (blockIdTop == 0) { // top block is empty

			// Ignore. Trying to put the same block on top.
			if (Global.selectedBlockId == blockIdBottom)
				return;

			blockIdTop = Global.selectedBlockId;
			Texture2D bottomTex = getTextureByBlockId (blockIdBottom);
			Texture2D topTex = getTextureByBlockId (blockIdTop);

			rawImage.texture = mixTextures (bottomTex, topTex);
			
			playBlockPlacedSound ();

		} else {
			// Ignore. Do nothing. Both layers are already busy.
		}
	}
开发者ID:balamsoft,项目名称:PaintCraft,代码行数:30,代码来源:DrawingCell.cs


示例8: Awake

    void Awake()
    {
        m_rawImage = GetComponent<RawImage>();
        gameObject.tag = "Layer";

        m_rawImage.enabled = false;
    }
开发者ID:kimryu,项目名称:MagiPieceProject01,代码行数:7,代码来源:Layer.cs


示例9: Start

 void Start()
 {
     this.rawImage = this.GetComponent<RawImage>();
         this.rawImage.color = Color.black;
         this.rawImage.gameObject.SetActive(false);
         Invoke("MoviePlay", .5f);
 }
开发者ID:patrickpissurno,项目名称:Oficina-2015,代码行数:7,代码来源:UI_GameWin.cs


示例10: UserImage

	IEnumerator UserImage(string url,RawImage image)
	{
		WWW www = new WWW(url); 
		Texture2D textFb2 = new Texture2D(128, 128, TextureFormat.DXT1, false); //TextureFormat must be DXT5
		yield return www;
		Avatar.texture = www.texture;
	}
开发者ID:SonGit,项目名称:NailGame,代码行数:7,代码来源:InviteFriendItem.cs


示例11: Awake

				void Awake ()
				{	
						handState = HandState.NoAction;
						
						leapManager = (GameObject.Find ("LeapManager") as GameObject).GetComponent (typeof(LeapManager)) as LeapManager;
						cueStickController = (GameObject.Find ("CueStickTip") as GameObject).GetComponent (typeof(CueStickController)) as CueStickController;

						leapManager.leapController.EnableGesture (Gesture.GestureType.TYPE_SWIPE);
						leapManager.leapController.Config.SetFloat ("Gesture.Swipe.MinLength", 200.0f);
						leapManager.leapController.Config.SetFloat ("Gesture.Swipe.MinVelocity", 750f);
						leapManager.leapController.Config.Save ();

						gameStates.Add (GameState.CameraAutoAdjust);
						gameStates.Add (GameState.CameraManualAdjust);
						gameStates.Add (GameState.Aiming);
						gameStates.Add (GameState.AfterShot);
						gameStates.Add (GameState.TurnEnd);

						

						viewAdjustmentStateIcon = (GameObject.Find ("ViewAdjustmentStateIcon") as GameObject).GetComponent (typeof(RawImage)) as RawImage; 
						aimingStateIcon = (GameObject.Find ("AimingStateIcon") as GameObject).GetComponent (typeof(RawImage)) as RawImage; 
						swipeActionIcon = (GameObject.Find ("SwipeActionIcon") as GameObject).GetComponent (typeof(RawImage)) as RawImage;

						playerTurn = (GameObject.Find ("PlayerTurn") as GameObject).GetComponent (typeof(Text)) as Text; 
						cueBall = GameObject.FindGameObjectWithTag ("cueBall");

						cueBall = GameObject.FindGameObjectWithTag ("cueBall");
						camera = GameObject.FindGameObjectWithTag ("PlayerCamera");
						ballsParent = GameObject.FindGameObjectWithTag ("balls");
						foreach (Transform ball in ballsParent.transform) {
								balls.Add (ball.gameObject);				
						}
				}
开发者ID:ly774508966,项目名称:leapMotion8Ball,代码行数:34,代码来源:Game.cs


示例12: Start

 // Use this for initialization
 void Start()
 {
     rawimage = image.GetComponent<RawImage>();
     rawimage.CrossFadeAlpha(0.0F,0, false);
     rawimage.CrossFadeAlpha(1F,splash_timer, false);
     StartCoroutine("Timer");
 }
开发者ID:Aldian1,项目名称:Project-Towns,代码行数:8,代码来源:MenuController.cs


示例13: Start

 /// <summary>
 /// Updateを行う前の最初のフレームに呼び出される関数
 /// </summary>
 void Start()
 {
     // 画像のスクリプトを取得する
     transparentImage = GetComponent<RawImage>();
     // 最初の透過度を取得しておく
     firstAlpha = transparentImage.color.a;
 }
开发者ID:GochiMMO,项目名称:MMO,代码行数:10,代码来源:OnMouseAndTransparent.cs


示例14: Awake

    void Awake()
    {
        instance = this;

        topCard = GameObject.Find("cardDeck").GetComponentInChildren<RawImage>();
        cards = GameObject.Find("cardSelected").GetComponentsInChildren<RawImage>();
    }
开发者ID:schmjdt,项目名称:cpi211,代码行数:7,代码来源:CardSelection.cs


示例15: Start

    // Use this for initialization
    void Start () {
        penX.onValueChange.AddListener(ChangePenX);
        penY.onValueChange.AddListener(ChangePenY);
        brushX.onValueChange.AddListener(ChangeBrushX);
        brushY.onValueChange.AddListener(ChangeBrushY);
        bSize.onValueChange.AddListener(ChangeBSize);

        penX.text = PlayerPrefs.GetInt("penOffsetX", 0).ToString();
        penY.text = PlayerPrefs.GetInt("penOffsetY", 0).ToString();
        brushX.text = PlayerPrefs.GetInt("brushOffsetX", 0).ToString();
        brushY.text = PlayerPrefs.GetInt("brushOffsetY", 0).ToString();
        bSize.text = PlayerPrefs.GetInt("bSize", 10).ToString();

        var detector = DrawUtility.CreateDetector(prefab);

        detector.OnStartPaint += new PaintingDetector2D.DelegatePaint(OnStartPaint);
        detector.OnPaintMovement += new PaintingDetector2D.DelegatePaint(OnPaintMovement);
        detector.OnPaintEnd += new PaintingDetector2D.DelegatePaint(OnPaintEnd);


        drawRect = DrawUtility.CreateRectTransform(prefab, new Vector2(Screen.width, Screen.height));
        drawImage = drawRect.GetComponent<RawImage>();
        paintTexture = DrawUtility.CreateCanvas(Screen.width, Screen.height);
        drawImage.texture = paintTexture;

        btn.onClick.AddListener(Click);
    }
开发者ID:Blizzardx,项目名称:ClientFrameWork,代码行数:28,代码来源:DrawSetting.cs


示例16: Awake

	void Awake(){
		screenFader = GetComponent<RawImage>();

		if (screenFader == null) {
			throw new UnityException ("No Screen Fader added");
		}
	}
开发者ID:luckyvan,项目名称:Unity-Stealth-5.0,代码行数:7,代码来源:ScreenFadeInOut.cs


示例17: Start

 // Use this for initialization
 void Start()
 {
     canvas = (RectTransform)this.GetComponent(typeof(RectTransform));
     cam = Camera.main;
     image = (UnityEngine.UI.RawImage)this.GetComponent(typeof(UnityEngine.UI.RawImage));
     maxWidth = canvas.rect.width;
 }
开发者ID:Shentoza,项目名称:GPM,代码行数:8,代码来源:UI_FireBar.cs


示例18: Start

    private RectTransform rTrans; //rect transform component

    #endregion Fields

    #region Methods

    // Use this for initialization
    void Start()
    {
        rImg = GetComponent<RawImage>();
        rTrans = GetComponent<RectTransform>();
        rTrans.sizeDelta = new Vector2(Screen.width, Screen.height);
        rImg.color = Color.Lerp(rImg.color, new Color(1,1,1,0.15f), 0.04f);
    }
开发者ID:redahanb,项目名称:Spectral,代码行数:14,代码来源:ScreenOverlayPattern.cs


示例19: Initialize

    public void Initialize()
    {
        GameObject ob = GameObject.Find("COLLECT_PLACE");
        if (ob != null)
        {
            RawImage rawimage = ob.transform.GetChild(0).GetComponent<RawImage>();
            rawimage.gameObject.SetActive(true);

            Image = Instantiate<RawImage>(rawimage);
            Image.transform.parent = ob.gameObject.transform;
            Image.name += "-" + gameObject.name;
            Image.transform.localScale = new Vector3(1, 1, 1);

            RectTransform rect = Image.GetComponent<RectTransform>();
            RectTransform rectorgi = rawimage.GetComponent<RectTransform>();

            this.rect = rect;

            rect.offsetMin = new Vector2(rectorgi.offsetMin.x, rectorgi.offsetMin.y);
            rect.offsetMax = new Vector2(rectorgi.offsetMax.x, rectorgi.offsetMax.y);

            Image.texture = GetComponent<Building>().ResourceProduction.getSprite().texture;
            rawimage.gameObject.SetActive(false);

        }
        else Debug.LogError("Cant Find TIMER_TEXT");
    }
开发者ID:Lukasz199312,项目名称:ClickCraft,代码行数:27,代码来源:MoveItemCollect.cs


示例20: SetupImages

	void SetupImages() {
		//MyPlayer1.GetComponent<CustomController>().m_Camera = MyPlayer1.gameObject.transform.GetChild(0).GetComponent<Camera>();
		//MyPlayer2.GetComponent<CustomController>().m_Camera = MyPlayer2.gameObject.transform.GetChild(0).GetComponent<Camera>();
		
		GameObject MyImage1Object = new GameObject ();
		MyImage1Object.AddComponent<RawImage> ();
		MyImage1 = MyImage1Object.GetComponent<RawImage>();
		MyImage1.GetComponent<RawImage> ().texture = MyRenderTexture1;
		RectTransform MyRectTransform1 = MyImage1Object.GetComponent<RectTransform> ();
		MyRectTransform1.anchorMin = new Vector2 (0, 0);
		MyRectTransform1.anchorMax = new  Vector2 (1, 1);
		MyRectTransform1.sizeDelta = new Vector2(0, 0);
		MyRectTransform1.localPosition = new Vector2 (0, 0);
		MyImage1Object.layer = MyUILayer;
		MyImage1Object.name = "MyImage1";
		MyImage1Object.transform.SetParent (MyCanvas.transform, false);
		
		GameObject MyImage2Object = new GameObject ();
		MyImage2Object.AddComponent<RawImage> ();
		MyImage2 = MyImage2Object.GetComponent<RawImage>();
		MyImage2.GetComponent<RawImage> ().texture = MyRenderTexture2;
		RectTransform MyRectTransform2 = MyImage2Object.GetComponent<RectTransform> ();
		MyRectTransform2.anchorMin = new Vector2 (0, 0);
		MyRectTransform2.anchorMax = new  Vector2 (1, 1);
		MyImage2Object.transform.SetParent (MyCanvas.transform, false);
		MyImage2Object.name = "MyImage2";
		MyImage2Object.layer = MyUILayer;
		
		MyImage1Object.SetActive (false);
		MyImage2Object.SetActive (false);
		SpawnedMainCamera = new GameObject ();
		SpawnedMainCamera.AddComponent<Camera> ();
		SpawnedMainCamera.tag = "MainCamera";
		SpawnedMainCamera.SetActive (false);
	}
开发者ID:Deus0,项目名称:Zeltex,代码行数:35,代码来源:FadeCamera.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# UI.Text类代码示例发布时间:2022-05-26
下一篇:
C# UI.Image类代码示例发布时间: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