本文整理汇总了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();
}
示例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
}
}
示例3: Awake
private void Awake()
{
slider = GetComponent<BoxSlider>();
image = GetComponent<RawImage>();
RegenerateSVTexture();
}
示例4: Start
// Use this for initialization
void Start()
{
if (this.AnyBladeModeElement)
{
this.BladeModeElementRawImage = this.AnyBladeModeElement.GetComponent<RawImage>();
}
}
示例5: Start
// Use this for initialization
protected void Start () {
rectTransform = (RectTransform)this.GetComponent<RectTransform> ();
rawImage = (RawImage) this.GetComponent<RawImage> ();
Reset ();
GetZoneInfos ();
}
示例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;
}
示例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.
}
}
示例8: Awake
void Awake()
{
m_rawImage = GetComponent<RawImage>();
gameObject.tag = "Layer";
m_rawImage.enabled = false;
}
示例9: Start
void Start()
{
this.rawImage = this.GetComponent<RawImage>();
this.rawImage.color = Color.black;
this.rawImage.gameObject.SetActive(false);
Invoke("MoviePlay", .5f);
}
示例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;
}
示例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);
}
}
示例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");
}
示例13: Start
/// <summary>
/// Updateを行う前の最初のフレームに呼び出される関数
/// </summary>
void Start()
{
// 画像のスクリプトを取得する
transparentImage = GetComponent<RawImage>();
// 最初の透過度を取得しておく
firstAlpha = transparentImage.color.a;
}
示例14: Awake
void Awake()
{
instance = this;
topCard = GameObject.Find("cardDeck").GetComponentInChildren<RawImage>();
cards = GameObject.Find("cardSelected").GetComponentsInChildren<RawImage>();
}
示例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);
}