本文整理汇总了C#中UnityEngine.RectTransform.RootCanvasTransform方法的典型用法代码示例。如果您正苦于以下问题:C# RectTransform.RootCanvasTransform方法的具体用法?C# RectTransform.RootCanvasTransform怎么用?C# RectTransform.RootCanvasTransform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.RectTransform
的用法示例。
在下文中一共展示了RectTransform.RootCanvasTransform方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
// Use this for initialization
void Init()
{
// Debug.Log("apply");
us=gameObject.GetComponent<RectTransform>();
//from=us.parent as RectTransform;
us.SetParent(us.RootCanvasTransform());
us.SetInternalAnchors (new Vector4 (0, 0, 1, 1));
//start=us.rect;
//reference=from.rect;
Rect rr = to.RootCanvasRect ();
// Debug.Log(rr);
tovec = (us.parent as RectTransform).getAnchorsFromCanvasRect (rr);
// Debug.Log(tovec);
stvec = new Vector4 (us.anchorMin.x,us.anchorMin.y,us.anchorMax.x,us.anchorMax.y);
}
示例2: Init
void Init()
{
trans= gameObject.GetComponent<RectTransform>();
if(trans==null)
{
Destroy(this);return;
}
canv=trans.RootCanvasTransform();
//canvrect=canv.rect;
taillen=height*tail.width/tail.height;
headlen=height*head.width/head.height;
bodylen=height*body.width/body.height;
}
示例3: Start
// CardFlip flip;
// Use this for initialization
//public SingleGame.Conditional cardData;
public override void Start()
{
rtransform=gameObject.GetComponent<RectTransform>();
canv=rtransform.RootCanvasTransform();
text.text=cardData[SingleGame._cardText] as string;
string imgname=cardData["_cardImage"] as string;
if(imgname !=null)
{
Texture2D txt=Resources.Load(imgname) as Texture2D;
if(txt!=null)
cardImg.texture=txt;
}
game=cardData[SingleGame._rootl] as SingleGame.Conditional;
player1=game["Player1"] as SingleGame.Conditional;
}