Help us understand the problem. What is going on with this article?

【Unity】iTweenでハマったことメモ

More than 5 years have passed since last update.

MoveBy関数には「islocal」パラメータがない

MoveByでislocalパラメータを追加してもエラーにならないため要注意!!!
ちなみにMoveToやMoveFromはありました。

アニメーションが終わったら呼ばれる関数(コールバック関数)にはターゲットが必要

たとえば、iTweenの移動処理が終わってゲームオブジェクトを削除したい場合は
oncompleteを保有しているゲームオブジェクトを明記したほうがいい

itween.cs
void OnTriggerStay(Collider other) {
    ins = Instantiate(PlusMoneyPrefab) as GameObject;

    Vector3 startPosition = new Vector3(startX, startY, -1);
    ins.transform.parent = Respawn.transform;
    ins.transform.localPosition = startPosition;
    ins.transform.localScale = new Vector3(50, 50, 0);

    Hashtable parameters = new Hashtable();
    parameters.Add("y", startY + 80);
    parameters.Add("islocal", true);
    parameters.Add("easeType", "easeInOutExpo");
    parameters.Add("time", 2);
    parameters.Add("oncomplete", "CompleteHandler");
    parameters.Add("oncompletetarget", gameObject);

    iTween.MoveTo(ins, parameters);
}

void CompleteHandler() {
    Destroy (ins);
}
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away