I want to animate gameobjects from the lists. I need to switch their visibility on with the “onstart”, but can not get the below script working:
import System.Collections.Generic;
var goList: List.<GameObject>;
var del2: float;
var t00: float;
for (var i=0; i<n; i++) {
//incorrtect
iTween.MoveBy(goList_,{"z":-5, "delay":t00 + i2*del2,"onstart":"activate", "onstarttarget":"gameObject","onstartparams":"i"});_
//correct
iTween.MoveBy(goList_,{“z”:-5, “delay”:t00 + i2*del2,“onstart”:“activate”, “onstarttarget”:gameObject,“onstartparams”:i});_
* }*
function activate (k) {
* goList[k].renderer.enabled = true;*
}
Actually I am getting a runtime error:
InvalidCastException: Cannot cast from source type to destination type.