标签: itween

如何在Unity iTween插件中使用oncompleteparams?

我有代码:

iTween.MoveTo(
gameObject,
iTween.Hash("x",_x,"z",_y, "time", 2.0f, "easetype",
iTween.EaseType.easeInExpo,
"oncomplete", "afterPlayerMove",
"oncompleteparams", iTween.Hash("value", _fieldIndex)
));
Run Code Online (Sandbox Code Playgroud)

但我不知道如何使用oncompleteparams官方手册中没有示例。

如何使用 oncompleteparams ?

c# animation callback unity-game-engine itween

1
推荐指数
1
解决办法
3889
查看次数

Unity3D:iTween oncomplete 不工作

我正在开发 Unity2 游戏,我想让 Boom 在iTween动画结束时消失。

这是代码的一部分

void OnMouseDown() {    

    if (ChosePosition == false)
        ChosePosition = true;

    // make Star stop
    else if (ChosePosition == true && ChoseForce == false) {
        ChoseForce = true;
        //Compute Force power 
        PowerDegree = Mathf.Abs (Star.transform.position.y - StarPosition)/ Mathf.Abs(StarendPosition - StarPosition) * 100;

        //print (PowerDegree);

        Vector3 NewBoomPostion = new Vector3 (Luncher.transform.position.x, BoomPosition, 85);

        GameObject newBoom = Instantiate(Boom, NewBoomPostion , Quaternion.identity) as GameObject;
        iTween.MoveTo (newBoom, iTween.Hash 
            ("y",BoomPosition+((BoomendPosition-BoomPosition)/100*PowerDegree),
            "speed",Boomspeed,
            "EaseType",BoomeaseType,
            "LoopType",BoomloopType,
            "oncomplete","BoomComplete"
            ));


        CarrierReset = true; …
Run Code Online (Sandbox Code Playgroud)

c# unity-game-engine itween

0
推荐指数
1
解决办法
6364
查看次数

标签 统计

c# ×2

itween ×2

unity-game-engine ×2

animation ×1

callback ×1