当前位置: 首页>>代码示例>>C#>>正文


C# UI.RawImage类代码示例

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


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


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