本文整理汇总了C#中LTRect类的典型用法代码示例。如果您正苦于以下问题:C# LTRect类的具体用法?C# LTRect怎么用?C# LTRect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LTRect类属于命名空间,在下文中一共展示了LTRect类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start () {
gameOverButtonRect = new LTRect(-Screen.width*0.5f, Screen.height*0.4f, Screen.width*0.2f, Screen.height*0.2f);
for(int i = 0; i < avatars.Length; i++){
LeanTween.moveY(avatars[i], avatars[i].transform.position.y+4f, 1f).setDelay(i*0.25f).setLoopPingPong().setRepeat(2).setEase(LeanTweenType.easeOutSine);
LeanTween.rotate(avatars[i], avatars[i].transform.eulerAngles + new Vector3(45f,0f,0f), 1f).setLoopPingPong().setRepeat(2).setEase(LeanTweenType.easeInQuad);
}
LeanTween.delayedCall(gameObject, 5f, presentationOver);
}
开发者ID:YanivP,项目名称:FriendBubbles,代码行数:11,代码来源:TutorialPresentationFinished.cs
示例2: Start
// Use this for initialization
void Start () {
gameOverButton = new LTRect(-Screen.width*0.5f, Screen.height*0.4f, Screen.width*0.2f, Screen.height*0.2f);
for(int i = 0; i < avatars.Length; i++){
LeanTween.moveY( avatars[i], avatars[i].transform.position.y + 4f, 1f).setDelay(0.25f*i).setEase(LeanTweenType.easeOutCirc).setLoopPingPong().setRepeat(2);
LeanTween.rotate( avatars[i], avatars[i].transform.eulerAngles + new Vector3(45f, 0f, 0f), 1f).setLoopPingPong().setRepeat(2);
}
LeanTween.delayedCall(gameObject, 3f, gameOverScreen);
LeanTween.value(gameObject, changeValue, 5f, 8f, 1f);
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:13,代码来源:TutorialPresentation.cs
示例3: Start
// Use this for initialization
void Start () {
w = Screen.width;
h = Screen.height;
buttonRect1 = new LTRect(0.10f*w, 0.8f*h, 0.2f*w, 0.14f*h );
buttonRect2 = new LTRect(1.2f*w, 0.8f*h, 0.2f*w, 0.14f*h );
buttonRect3 = new LTRect(0.35f*w, 0.0f*h, 0.3f*w, 0.2f*h, 0f );
buttonRect4 = new LTRect(0.0f*w, 0.4f*h, 0.3f*w, 0.2f*h, 1.0f, 15.0f );
grumpyRect = new LTRect(0.5f*w - grumpy.width*0.5f, 0.5f*h - grumpy.height*0.5f, grumpy.width, grumpy.height );
beautyTileRect = new LTRect(0.0f,0.0f,1.0f,1.0f );
LeanTween.move( buttonRect2, new Vector2(0.55f*w, buttonRect2.rect.y), 0.7f ).setEase(LeanTweenType.easeOutQuad);
}
开发者ID:YanivP,项目名称:FriendBubbles,代码行数:14,代码来源:GUIExamplesCS.cs
示例4: MoveActionY
public static void MoveActionY(CanvasGroup cg, float to, float alpha, float time, float alphatime = -1, LeanTweenType type = LeanTweenType.linear, Action complete = null)
{
LTRect cgrect = new LTRect();
cgrect.alpha = cg.alpha;
alphatime = (alphatime < 0) ? to : alphatime;
LeanTween.alpha(cgrect, alpha, time).setEase(type);
LTDescr d = LeanTween.moveLocalY(cg.transform.gameObject, to, time).setEase(type);
d.setOnUpdate((float f) => { UpdateAlpha(cg, cgrect.alpha); });
if (complete != null)
{
d.setOnComplete(complete);
}
}
开发者ID:yuu416fgx8mlight,项目名称:GGJ2016_HDS,代码行数:13,代码来源:UIActionUtility.cs
示例5: Alpha
public static void Alpha(CanvasGroup cg,float alpha,float time,LeanTweenType type=LeanTweenType.linear,Action complete = null)
{
LTRect cgrect = new LTRect();
cgrect.alpha = cg.alpha;
LTDescr d = LeanTween.alpha(cgrect, alpha, time).setEase(type);
d.setOnUpdate((float f) => { UpdateAlpha(cg, cgrect.alpha); });
if (complete != null)
{
d.setOnComplete(complete);
}
}
开发者ID:yuu416fgx8mlight,项目名称:GGJ2016_HDS,代码行数:13,代码来源:UIActionUtility.cs
示例6: startPlayerHitAnim
public void startPlayerHitAnim(int playerNum)
{
this.playerNum = playerNum;
Time.timeScale = 0;
if (GameData.Instance.PlayerLives <= 0) {
return;
}
doAnim = true;
playerRect = new LTRect( 0f, 0f, 0f, 0f );
playerRect.setStyle(new GUIStyle(playerDiedStyle));
playerRect.setFontScaleToFit(true);
LeanTween.scale( playerRect, new Vector2(150f,100f), .75f ).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack).setOnComplete(delegate() {
StartCoroutine(resetGameBoard());
});
}
开发者ID:pmlamotte,项目名称:2Pac,代码行数:16,代码来源:PlayerDied.cs
示例7: getSavesRects
LTRect[] getSavesRects()
{
savesBtnsRects = new Dictionary<string, LTRect>();
int amount = Loader.instance.getSaves().Count;
float beginpos = 0.2f * ScrHeight;
float btnwidth = 0.4f * ScrWidth;
float btnheight = (ScrHeight - 2 * beginpos) / amount;
if (btnheight > height)
btnheight = height;
int i = 1;
foreach (var save in Loader.instance.getSaves())
{
if (savesBtnsRects.ContainsKey(save))
continue;
savesBtnsRects.Add(save, new LTRect(ScrWidth * 1.5f - btnwidth / 2, beginpos + btnheight * i, btnwidth, btnheight));
i++;
}
LTRect[] tab = new LTRect[savesBtnsRects.Count];
savesBtnsRects.Values.CopyTo(tab, 0);
return tab;
}
开发者ID:ZPZ-Gr2,项目名称:AwesomeGameInSpace,代码行数:23,代码来源:MenuAnimator.cs
示例8: isTweening
/**
* Test whether or not a tween is active on a LTRect
*
* @method LeanTween.isTweening
* @param {LTRect} ltRect:LTRect LTRect that you want to test if it is tweening
*/
public static bool isTweening( LTRect ltRect )
{
for( int i = 0; i < tweenMaxSearch; i++){
if(tweens[i].toggle && tweens[i].ltRect==ltRect)
return true;
}
return false;
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:14,代码来源:LeanTween.cs
示例9: cancel
/**
* Cancel a specific tween with the provided id
*
* @method LeanTween.cancel
* @param {LTRect} ltRect:LTRect LTRect object whose tweens you want to cancel
* @param {float} id:int unique id that represents that tween
*/
public static void cancel( LTRect ltRect, int uniqueId )
{
if(uniqueId>=0){
init();
int backId = uniqueId & 0xFFFF;
int backCounter = uniqueId >> 16;
// Debug.Log("uniqueId:"+uniqueId+ " id:"+backId +" action:"+(TweenAction)backType + " tweens[id].type:"+tweens[backId].type);
if(tweens[backId].ltRect == ltRect && tweens[backId].counter==backCounter)
removeTween((int)backId);
}
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:18,代码来源:LeanTween.cs
示例10: texture
public static LTRect texture( LTRect rect, Texture texture, int depth)
{
rect.type = Element_Type.Texture;
rect.texture = texture;
return element(rect, depth);
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:6,代码来源:LeanTween.cs
示例11: element
public static LTRect element( LTRect rect, int depth)
{
isGUIEnabled = true;
init();
int maxLoop = depth*RECTS_PER_LEVEL + RECTS_PER_LEVEL;
int k = 0;
if(rect!=null){
destroy(rect.id);
}
if(rect.type==LTGUI.Element_Type.Label && rect.style!=null){
if(rect.style.normal.textColor.a<=0f){
Debug.LogWarning("Your GUI normal color has an alpha of zero, and will not be rendered.");
}
}
if(rect.relativeRect.width==float.PositiveInfinity){
rect.relativeRect = new Rect(0f,0f,Screen.width,Screen.height);
}
for(int i = depth*RECTS_PER_LEVEL; i < maxLoop; i++){
r = levels[i];
if(r==null){
r = rect;
r.rotateEnabled = true;
r.alphaEnabled = true;
r.setId( i, global_counter );
levels[i] = r;
// Debug.Log("k:"+k+ " maxDepth:"+levelDepths[depth]);
if(k>=levelDepths[depth]){
levelDepths[depth] = k + 1;
}
global_counter++;
return r;
}
k++;
}
Debug.LogError("You ran out of GUI Element spaces");
return null;
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:39,代码来源:LeanTween.cs
示例12: setRect
public LTDescr setRect( LTRect rect )
{
this.ltRect = rect;
return this;
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:5,代码来源:LeanTween.cs
示例13: scale
public static int scale(LTRect ltRect, Vector2 to, float time, object[] optional)
{
return scale( ltRect, to, time, h(optional) );
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:4,代码来源:LeanTween.cs
示例14: constructor
public static int constructor(IntPtr l)
{
try {
int argc = LuaDLL.lua_gettop(l);
LTRect o;
if(argc==1){
o=new LTRect();
pushValue(l,o);
return 1;
}
else if(argc==2){
UnityEngine.Rect a1;
checkValueType(l,2,out a1);
o=new LTRect(a1);
pushValue(l,o);
return 1;
}
else if(argc==5){
System.Single a1;
checkType(l,2,out a1);
System.Single a2;
checkType(l,3,out a2);
System.Single a3;
checkType(l,4,out a3);
System.Single a4;
checkType(l,5,out a4);
o=new LTRect(a1,a2,a3,a4);
pushValue(l,o);
return 1;
}
else if(argc==6){
System.Single a1;
checkType(l,2,out a1);
System.Single a2;
checkType(l,3,out a2);
System.Single a3;
checkType(l,4,out a3);
System.Single a4;
checkType(l,5,out a4);
System.Single a5;
checkType(l,6,out a5);
o=new LTRect(a1,a2,a3,a4,a5);
pushValue(l,o);
return 1;
}
else if(argc==7){
System.Single a1;
checkType(l,2,out a1);
System.Single a2;
checkType(l,3,out a2);
System.Single a3;
checkType(l,4,out a3);
System.Single a4;
checkType(l,5,out a4);
System.Single a5;
checkType(l,6,out a5);
System.Single a6;
checkType(l,7,out a6);
o=new LTRect(a1,a2,a3,a4,a5,a6);
pushValue(l,o);
return 1;
}
LuaDLL.luaL_error(l,"New object failed.");
return 0;
}
catch(Exception e) {
LuaDLL.luaL_error(l, e.ToString());
return 0;
}
}
开发者ID:BobLChen,项目名称:hugula,代码行数:70,代码来源:Lua_LTRect.cs
示例15: Init
void Init()
{
// TODO: This can be refactored when we figure out how to load from a zip file or folder etc.
_Images = new List<Texture>()
{
Image1,
Image2,
Image3
};
float sliderLeft = (_W / 2) - (_ImageSliderWidth / 2);
float sliderTop = (_H / 2) - (_ImageSliderHeight / 2);
_SliderStart = new Vector2(sliderLeft, _H);
_SliderEnd = new Vector2(sliderLeft, sliderTop);
_ImageSliderBox = new LTRect(new Rect(_SliderStart.x, _SliderStart.y, _ImageSliderWidth, _ImageSliderHeight));
float buttonTop = sliderTop + _ImageSliderHeight + _SliderButtonOffsetTop;
float prevButtonLeft = sliderLeft - _BackgroundPadding.left;
float nextButtonLeft = sliderLeft + _ImageSliderWidth + _BackgroundPadding.right - _ButtonWidth;
_PrevButtonStart = new Vector2(-1 * _ButtonWidth, buttonTop);
_PrevButtonEnd = new Vector2(prevButtonLeft, buttonTop);
_PrevButtonBounceEnd = new Vector2(_PrevButtonEnd.x - _ButtonBounceOffset, _PrevButtonEnd.y);
_NextButtonStart = new Vector2(_W, buttonTop);
_NextButtonEnd = new Vector2(nextButtonLeft, buttonTop);
_NextButtonBounceEnd = new Vector2(_NextButtonEnd.x + _ButtonBounceOffset, _NextButtonEnd.y);
_PrevButton = new LTRect(new Rect(_PrevButtonStart.x, _PrevButtonStart.y, _ButtonWidth, _ButtonHeight));
_NextButton = new LTRect(new Rect(_NextButtonStart.x, _NextButtonStart.y, _ButtonWidth, _ButtonHeight));
}
开发者ID:nileshlg2003,项目名称:AR_App,代码行数:31,代码来源:ImageSliderGUI.cs
示例16: rotate
public static int rotate(LTRect ltRect, float to, float time, object[] optional)
{
return rotate( ltRect, to, time, h(optional) );
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:4,代码来源:LeanTween.cs
示例17: Start
// Use this for initialization
void Start()
{
w = Screen.width;
h = Screen.height;
// Model type init
ModelTypeList = GUIState.ModelTypes.Select (mt => mt.Value).ToList ();
ModelTypeButton = new LTRect (new Rect (-1 * (Padding + ButtonWidth), Padding, ButtonWidth, ButtonHeight));
DropDownBox = new LTRect (new Rect (Padding, (2 * Padding) + ButtonHeight, ButtonWidth, 0));
EmpireButton = new LTRect (new Rect (-1 * (Padding + ButtonWidth), (3 * Padding) + ButtonHeight, ButtonWidth, ButtonHeight));
VegasButton = new LTRect (new Rect (-1 * (Padding + ButtonWidth), (4 * Padding) + (2 * ButtonHeight), ButtonWidth, ButtonHeight));
// Function type init
EmpireFunctionTypeList = GUIState.EmpireFunctionTypes.Select (ft => ft.Value).ToList ();
VegasFunctionTypeList = GUIState.VegasFunctionTypes.Select (ft => ft.Value).ToList ();
FunctionTypeButton = new LTRect (new Rect (w + (Padding + ButtonWidth), Padding, ButtonWidth, ButtonHeight));
//EmpireBoxRect = new Rect(Padding, )
SlideInBox = new LTRect (new Rect (w - (4 * Padding + 2 * ButtonWidth), Padding - 2, 3 * Padding + 2 * ButtonWidth, 0));
FunctionButton1 = new LTRect (new Rect (w + Padding, Padding, ButtonWidth, ButtonHeight));
FunctionButton2 = new LTRect (new Rect (w + Padding, Padding, ButtonWidth, ButtonHeight));
// Initial animations
LeanTween.move (ModelTypeButton, new Vector2 (Padding, Padding), 1.0f).setEase (LeanTweenType.easeOutBack).setOnComplete (() => DropDownAnimationRunning = false);
}
开发者ID:nileshlg2003,项目名称:AR_App,代码行数:30,代码来源:TestGUI.cs
示例18: alpha
/**
* Fade a GUI Object
*
* @method LeanTween.alpha
* @param {LTRect} ltRect:LTRect LTRect that you wish to fade
* @param {float} to:float the final alpha value (0-1)
* @param {float} time:float The time with which to fade the object
* @return {LTDescr} LTDescr an object that distinguishes the tween
* @example
* LeanTween.alpha(ltRect, 1f, 1f) .setEase(LeanTweenType.easeInCirc);
*/
public static LTDescr alpha(LTRect ltRect, float to, float time)
{
ltRect.alphaEnabled = true;
return pushNewTween( tweenEmpty, new Vector3(to,0f,0f), time, TweenAction.GUI_ALPHA, options().setRect( ltRect ) );
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:16,代码来源:LeanTween.cs
示例19: label
public static LTRect label( LTRect rect, string label, int depth)
{
rect.type = Element_Type.Label;
rect.labelStr = label;
return element(rect, depth);
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:6,代码来源:LeanTween.cs
示例20: destroyAfter
public static LTDescr destroyAfter( LTRect rect, float delayTime)
{
return pushNewTween( tweenEmpty, Vector3.zero, delayTime, TweenAction.CALLBACK, options().setRect( rect ).setDestroyOnComplete(true) );
}
开发者ID:KittyMac,项目名称:LeanTween,代码行数:4,代码来源:LeanTween.cs
注:本文中的LTRect类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论