本文整理汇总了C#中UITexture类的典型用法代码示例。如果您正苦于以下问题:C# UITexture类的具体用法?C# UITexture怎么用?C# UITexture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UITexture类属于命名空间,在下文中一共展示了UITexture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartLoadingTexture
private void StartLoadingTexture()
{
if (!string.IsNullOrEmpty(textureUrl))
{
_uiTexture = gameObject.GetComponent<UITexture>();
if (!_uiTexture) {
_uiTexture = gameObject.AddComponent<UITexture>();
//Material mat = new Material(Shader.Find("Unlit/Transparent Colored (AlphaClip)"));
Material mat = new Material(Shader.Find("Unlit/Transparent Colored"));
_uiTexture.material = mat;
}
_uiTexture.MakePixelPerfect();
this.LoadTexture(textureUrl, (texture) => {
_uiTexture.mainTexture = texture;
_uiTexture.MakePixelPerfect();
if ((hack_x>0) && (hack_y>0))
{
gameObject.transform.localScale = new Vector3 (hack_x, hack_y, gameObject.transform.localScale.z);
}
/* Scale images if not retina */
/*
if (!AppGUISettings.IS_RETINA)
gameObject.transform.localScale = new Vector3 (gameObject.transform.localScale.x/2, gameObject.transform.localScale.y/2, gameObject.transform.localScale.z);
*/
});
}
}
示例2: Awake
void Awake()
{
myLabel = GetComponent<UILabel>();
daddy = transform.parent.gameObject;
myBackground = transform.parent.Find("Background").GetComponent<UITexture>();
}
示例3: Start
private void Start() {
texture = gameObject.GetComponent<UITexture>();
speedEnd = texture.gc.speedControl;
texture.gc.speedControl = 0;
revive = PlayerPrefs.GetInt("Revive");
_start = true;
}
示例4: Awake
void Awake()
{
m_instance = gameObject.GetComponent<DiamondToGoldUIViewManager>();
m_myTransform = transform;
FillFullNameData(m_myTransform);
m_lblDiamondToGoldUIFromDiamondText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIFromDiamondText2"]).GetComponent<UILabel>();
m_lblDiamondToGoldUIToGoldText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIToGoldText2"]).GetComponent<UILabel>();
m_lblDiamondToGoldUILastTimesText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUILastTimesText2"]).GetComponent<UILabel>();
m_tranGODiamondToGoldChoose = m_myTransform.FindChild(m_widgetToFullName["GODiamondToGoldChoose"]);
m_lblDiamondToGoldUIUseAllText1 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseAllText1"]).GetComponent<UILabel>();
m_texDiamondToGoldUIBtnTurnBG = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIBtnTurnBG"]).GetComponent<UITexture>();
m_goDiamondToGoldUIUseOKCancel = m_myTransform.FindChild(m_widgetToFullName["GODiamondToGoldUIUseOKCancel"]).gameObject;
m_lblDiamondToGoldUIUseInfoDiamondText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseInfoDiamondText2"]).GetComponent<UILabel>();
m_lblDiamondToGoldUIUseInfoGoldText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseInfoGoldText2"]).GetComponent<UILabel>();
m_goDiamondToGoldUIUseTipEnable = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseTipEnable"]).gameObject;
m_goGODiamondToGoldUIUseTipEnable = m_myTransform.FindChild(m_widgetToFullName["GODiamondToGoldUIUseTipEnable"]).gameObject;
m_goDiamondToGoldUIUseTipEnableBGDown = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseTipEnableBGDown"]).gameObject;
m_goDiamondToGoldUIUseAllCheckDown = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseAllCheckDown"]).gameObject;
m_goDiamondToGoldUIUseOneCheckDown = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseOneCheckDown"]).gameObject;
m_lblDiamondToGoldUIDiamondNum = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIDiamondNum"]).GetComponentsInChildren<UILabel>(true)[0];
m_lblDiamondToGoldUIGoldNum = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIGoldNum"]).GetComponentsInChildren<UILabel>(true)[0];
IsShowGoldMetallurgyTipDialog = SystemConfig.Instance.IsShowGoldMetallurgyTipDialog;
Initialize();
}
示例5: Init
public void Init(bool shouldScroll = false, bool shouldGrey = false)
{
GameObject gameObject = base.transform.Find("activeSkill").gameObject;
this.mActiveSkill = gameObject.transform.Find("skill").GetComponent<UITexture>();
UIEventListener expr_41 = UIEventListener.Get(this.mActiveSkill.gameObject);
expr_41.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_41.onPress, new UIEventListener.BoolDelegate(this.OnSkillIconPress));
for (int i = 0; i < 3; i++)
{
this.mPassiveSkills[i] = base.transform.Find(string.Format("passiveSkill{0}", i)).gameObject;
this.mPassiveSkillIcons[i] = this.mPassiveSkills[i].transform.Find("skill").GetComponent<UISprite>();
UIEventListener expr_C7 = UIEventListener.Get(this.mPassiveSkillIcons[i].gameObject);
expr_C7.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_C7.onPress, new UIEventListener.BoolDelegate(this.OnPassiveSkillIconPress));
this.mPassiveSkillIconGreys[i] = this.mPassiveSkills[i].transform.Find("skillGrey").GetComponent<UISprite>();
UIEventListener expr_11E = UIEventListener.Get(this.mPassiveSkillIconGreys[i].gameObject);
expr_11E.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_11E.onPress, new UIEventListener.BoolDelegate(this.OnPassiveSkillIconPress));
}
if (shouldScroll)
{
this.mActiveSkill.gameObject.AddComponent<UIDragScrollView>();
for (int j = 0; j < 3; j++)
{
this.mPassiveSkillIcons[j].gameObject.AddComponent<UIDragScrollView>();
this.mPassiveSkillIconGreys[j].gameObject.AddComponent<UIDragScrollView>();
}
}
if (shouldGrey)
{
for (int k = 0; k < 3; k++)
{
this.mPassiveSkillIconGreys[k].color = Color.black;
}
}
}
示例6: SetComponents
/// <summary>
/// Sets the components.
/// </summary>
/// <param name='_sprite'>
/// _sprite.
/// </param>
/// <param name='_stretch'>
/// _stretch.
/// </param>
public void SetComponents(UITexture _texture, UIStretch _stretch)
{
texture = _texture;
transform = texture.transform;
stretch = _stretch;
}
示例7: Start
void Start ()
{
mTrans = transform;
mUITex = GetComponent<UITexture>();
mCam = UICamera.FindCameraForLayer(gameObject.layer);
mWidth = mUITex.width;
mHeight = mUITex.height;
Color[] cols = new Color[mWidth * mHeight];
for (int y = 0; y < mHeight; ++y)
{
float fy = (y - 1f) / mHeight;
for (int x = 0; x < mWidth; ++x)
{
float fx = (x - 1f) / mWidth;
int index = x + y * mWidth;
cols[index] = Sample(fx, fy);
}
}
mTex = new Texture2D(mWidth, mHeight, TextureFormat.RGB24, false);
mTex.SetPixels(cols);
mTex.filterMode = FilterMode.Trilinear;
mTex.wrapMode = TextureWrapMode.Clamp;
mTex.Apply();
mUITex.mainTexture = mTex;
Select(value);
}
示例8: Start
public void Start()
{
name = gameObject.name;
if(GetComponentInChildren<Transform>())
backGroundChildren = GetComponentInChildren<UITexture>();
//Buttons.Instance.AddButton(this);
}
示例9: Awake
void Awake()
{
tex = transform.GetComponentsInChildren<UITexture>(true)[0];
ta = transform.GetComponentsInChildren<TweenAlpha>(true)[0];
GetComponentsInChildren<UIFXUnit>(true)[0].UIFXPlayFuncWithFloat = Play;
GetComponentsInChildren<UIFXUnit>(true)[0].UIFXStopFuncWithFloat = Stop;
}
示例10: InitWithBaseScene
public void InitWithBaseScene(GameObject go)
{
this.mModelTexture = base.transform.GetComponent<UITexture>();
this.CreateRenderTexture();
this.CreateRenderCamera(go);
this.mModelTexture.shader = Shader.Find("Unlit/Transparent Colored");
this.mModelTexture.mainTexture = this.mRenderTexture;
}
示例11: Start
// Use this for initialization
void Start () {
TextureSize = MoveTexture.Length;
MoveMaxTick = TextureSize;
UT = GetComponent<UITexture>();
// BaseShader = UT.shader;
}
示例12: Awake
public override void Awake()
{
base.Awake();
_uiTexture = gameObject.GetComponent<UITexture>();
width = transform.localScale.x;
height = transform.localScale.y;
}
示例13: Init
public void Init()
{
GameObject parent = GameUITools.FindGameObject("skills", base.gameObject);
this.mActive = GameUITools.FindGameObject("active", parent);
this.mActiveSkill = GameUITools.FindGameObject("skill", this.mActive).GetComponent<UITexture>();
UIEventListener expr_4D = UIEventListener.Get(this.mActiveSkill.gameObject);
expr_4D.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_4D.onPress, new UIEventListener.BoolDelegate(this.OnSkillIconPress));
}
示例14: FindObjects
public void FindObjects () {
mStageManager = GetComponentInParent<StageManager> ();
mIdolStageStatusManager = GetComponentInChildren<IdolStageStatusManager> ();
mBackgroundTexture = GetComponentInChildren<UITexture> ();
mSkipConstructionButtonObject = transform.FindChild ("SkipConstructionButton").gameObject;
mSleepObject = transform.FindChild ("Sleep").gameObject;
mIdolStageStatusManager.FindObjects ();
}
示例15: Start
void Start ()
{
if (this.uiTexture != null)
this.uiTexture = this.GetComponent<UITexture> ();
if (this.textureList.Count == 0)
Debug.Log(this.gameObject.name+"のTextureAnimation-textureListに画像が設定されていません。");
}