How can I use iTween(C# or JS version) in Unity iPhone?

I use C# to develop my game in Unity iPhone, first I use iTween(C# version) to Deal with animation of GUI,but It’s not work,The wrong message is

Assets/Plugins/iTween.cs(308,20): error CS1041: Identifier expected

I find the reason of wrong message is

public List<Vector3> beziers

in iTween.cs, I cann’t solve it, so I use iTween.js in my programe,but I meet new question.my code is

using UnityEngine;
using System.Collections;

public class UITest : MonoBehaviour 
{

    void Awake()
    {

    }

    // Use this for initialization
    void Start () 
    {

        iTween.moveTo(gameObject, {"x":0.5, "time":0.5, "delay":1.5});
    }

    // Update is called once per frame
    void Update () 
    {

    }
}

But it’s wrong,the wrong message is:

Assets/CSharp/UITest.cs(24,43): error CS1026: Expected ',' or ')'

so I change code to this:

using UnityEngine;
using System.Collections;

public class UITest : MonoBehaviour 
{


    void Awake()
    {
    }

    // Use this for initialization
    void Start () 
    {
        Hashtable ht = new Hashtable();
        ht.Add("x", 0.5);
        ht.Add("time", 0.5);
        ht.Add("delay", 1.5);

        iTween.moveTo(gameObject, ht);
    }

    // Update is called once per frame
    void Update () 
    {

    }
}

The wrong message is disappear,But It’s has new wrong message when I install my program into iPhone. The wrong message is:

2010-07-14 03:12:56.741 AcientHunter[498:207] -> registered unity classes
2010-07-14 03:12:56.877 AcientHunter[498:207] -> registered mono modules
-> applicationDidFinishLaunching()
 Failed to load AOT module '1089df34bcba0441c95e338b6f22270a' while running in aot-only mode because a dependency cannot be found or it is out of date.

My C# is in Asset/CSharp,iTween(JS version) is in Asset/Plugins. Help!!!
I have crazy!!!
PS:I use Unity iPhone 1.5[/code]

If you are using iTween .JS with C# you need to put it into your Plugins folder.

The error you are getting with using the C# version is because you need to set your .NET version to 2.0.

I hope this helps.

(1)I have put iTween.js into Asset/Plugins when I’m using iTween.js with C#.But it has another question when I install my program into my iPhone.The wrong message is:

2010-07-14 03:12:56.741 AcientHunter[498:207] -> registered unity classes 
2010-07-14 03:12:56.877 AcientHunter[498:207] -> registered mono modules 
-> applicationDidFinishLaunching() 
 Failed to load AOT module '1089df34bcba0441c95e338b6f22270a' while running in aot-only mode because a dependency cannot be found or it is out of date.

(2)I’m using Unity for iPhone 1.5,which .NET version is 1.1, How can I change it to .NET version 2.0?

I don’t believe that error has anything to do with iTween. Take a look at this: http://forum.unity3d.com/viewtopic.php?p=307627

If you’d like to change your .NET version to use the C# version simply go to Edit > Project Settings > Player > Api Compatibility Level

Good luck!

Thank you very much!!! I have seen the answer of URL, but it’s cann’t solved my question! So I think to change my .NET version, but I cann’t find Api Compatibility Level in Unity iPhone 1.5 Edit > Project Settings > Player.

:frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning: :frowning:

I can’t remember if it’s the same for 1.5 but in 1.7 take a look at the attached image.

346660--12077--$screen_shot_2010_07_15_at_12055_am_182.png

I can’t think of a good reason to use that. In fact any apps built with 1.5 will get rejected. (1.5.1 will work, but 1.6 is significantly better.)

–Eric

Thank you!!! The reason of Failed to load AOT module is currently JS code can’t be called from C# in Unity iPhone 1.5.1.I have upgrade my Unity iPhone to 1.7 version,the iTween.cs has been used in my program!!!

Thank you for your proposal,I have upgrade my Unity iPhone to 1.7 version now.