本文整理汇总了C#中Transform.DOScale方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.DOScale方法的具体用法?C# Transform.DOScale怎么用?C# Transform.DOScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform.DOScale方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Attack
// Instantie et modifie la taille du rayon
IEnumerator Attack()
{
if(playerTooFar == false)
{
GetComponent<BossAttack>().rotationSpeed = 0.05f;
fireRayTf = (Instantiate(fireRay, fireRaySpawn.position, transform.rotation) as GameObject).GetComponent<Transform>();
fireRayTf.SetParent(transform);
fireRayTf.DOScale(1, 0);
fireRayTf.GetChild(0).DOScale(new Vector3(0.178734f, 1.87f, 0f), timeDuration).SetEase(ease);
yield return new WaitForSeconds(fireRayDuration);
StartCoroutine("DestroyAndCoolDown");
}
yield break;
}
示例2: Start
void Start ()
{
// Caches
spriteRenderer = GetComponent<SpriteRenderer>();
myTransform = GetComponent<Transform>();
// Set initial alpha
Color color = spriteRenderer.material.color;
spriteRenderer.material.color = new Color(color.r, color.g, color.b, 0.4f);
float duration = Random.Range(0.8f, 1.6f);
// Tween alpha
spriteRenderer.material
.DOFade(0.1f, duration)
.SetEase(Ease.InOutSine)
.SetLoops(-1, LoopType.Yoyo);
// Tween scale
myTransform.DOScale(new Vector3(0.75f, 0.5f, 1f), duration)
.SetEase(Ease.InOutSine)
.SetLoops(-1, LoopType.Yoyo);
}
示例3: EmitDOTweenScaleFor
void EmitDOTweenScaleFor(Transform t, Vector3 to, float twDuration, DG.Tweening.Ease ease)
{
t.localScale = Vector3.one;
t.DOScale(to, twDuration).SetEase(ease).OnComplete(()=> EmitDOTweenScaleFor(t, to, twDuration, ease));
}
示例4: GameObject
/*private static Transform CreatSpriteRenderer(char num)
{
GameObject go = new GameObject();
SpriteRenderer spriteRenderer = go.AddComponent<SpriteRenderer>();
string path = "Assets/IconsPackage/UI_release/num/R0" + num + ".png";
spriteRenderer.sprite = Resources.LoadAssetAtPath(path, typeof(Sprite)) as Sprite;
go.name = "Num" + num;
numWidth = spriteRenderer.bounds.size.x;
//go.layer = LayerMask.NameToLayer("UI3D");
return go.transform;
}*/
public static void MoveNumber(Transform target, float durationTime, float distance, float delayTime)
{
target.DOScale(Vector3.zero, 0);
target.DOMoveY(distance, durationTime).SetRelative(true).OnComplete(() =>
{
GlobalData.Instance.Delay(delayTime, (o) => { DestoryTransform(o as Transform); }, target);
});
target.DOScale(new Vector3(2.2f, 2.2f, 2.2f), durationTime);
}
示例5: DOScale
public static Tweener DOScale(Transform target, Vector3 endValue, float duration, int loops = -1, LoopType loopType = LoopType.Yoyo, float delay = 0, System.Action doComplete = null)
{
Tweener tweener = target.DOScale(endValue, duration);
tweener.SetLoops(loops, loopType);
SetTweenerComplete(tweener, delay, doComplete);
return tweener;
}