本文整理汇总了C#中Rect.Splite方法的典型用法代码示例。如果您正苦于以下问题:C# Rect.Splite方法的具体用法?C# Rect.Splite怎么用?C# Rect.Splite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect.Splite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
UpdateLanguage();
bannerView = new BannerView("ca-app-pub-5734115412286766/9250985339", AdSize.Banner, AdPosition.Bottom);
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd(request);
//interstitial = new InterstitialAd("ca-app-pub-5734115412286766/5423314134");
//interstitial.AdLoaded += new System.EventHandler<System.EventArgs>((sender,e) =>{
// interstitial.Show();
//});
//AdRequest request = new AdRequest.Builder().Build();
//interstitial.LoadAd(request);
//if (interstitial.IsLoaded())
//{
// interstitial.Show();
//}
Debug.Log("GmeOverScript Start");
RawImage leftImage = GameObject.Find("/Canvas/RawImageLeft").GetComponent<RawImage>();
RawImage rightImage = GameObject.Find("/Canvas/RawImageRight").GetComponent<RawImage>();
// for debug data
//PersistentObjectScript persistentScript = new PersistentObjectScript();
//persistentScript.UpColors.Add(new Phoenix.HSB96(0, 0.5f, 0.5f));
//persistentScript.UpColors.Add(new Phoenix.HSB96(60, 0.5f, 0.5f));
//persistentScript.UpColors.Add(new Phoenix.HSB96(120, 0.5f, 0.5f));
//persistentScript.UpColors.Add(new Phoenix.HSB96(180, 0.5f, 0.5f));
//persistentScript.UpColors.Add(new Phoenix.HSB96(240, 0.5f, 0.5f));
//persistentScript.UpColors.Reverse();
Rect leftRect = new Rect(0, 0, 100, 261);
Texture2D leftTexture = new Texture2D((int)leftRect.width, (int)leftRect.height);
Texture2D rightTexture = new Texture2D((int)leftRect.width, (int)leftRect.height);
var leftRects = leftRect.Splite(GameGlobalScript.Instance.UpColors.Count);
leftRects.Reverse();
for (int i = 0; i < GameGlobalScript.Instance.UpColors.Count; i++)
{
leftTexture.DrawSolidRect(leftRects[i], GameGlobalScript.Instance.UpColors[i]);
rightTexture.DrawSolidRect(leftRects[i], GameGlobalScript.Instance.PickedColors[i]);
}
leftTexture.Apply();
rightTexture.Apply();
leftImage.texture = leftTexture;
rightImage.texture = rightTexture;
Score = GameGlobalScript.Instance.FinalScore;
GameGlobalScript.Instance.UpColors.Clear();
GameGlobalScript.Instance.PickedColors.Clear();
}