public static CCMoveToAction GetSSAction(GameObject gameObject, Vector3 _target, float speed, ISSActionCallback _callback) { CCMoveToAction action = ScriptableObject.CreateInstance <CCMoveToAction>(); action.target = _target; action.speed = speed; action.gameobject = gameObject; action.transform = gameObject.transform; action.callback = _callback; return(action); }
public void FlyUFO(List <GameObject> waitToFly, Ruler ruler, int round) { List <SSAction> toMove = new List <SSAction>(); for (int i = 0; i < waitToFly.Count; i++) { toMove.Add(CCMoveToAction.GetSSAction(waitToFly[i], ruler.getDes(waitToFly[i].transform.position), ruler.getSpeed(round) * AnimateSpeed, null)); } sequenceAction action = sequenceAction.GetSSAction(1, 0, toMove, this); addAction(action); }
public void FlyUFO(List <GameObject> waitToFly, Ruler ruler, int round) { SSAction action; float waitTime = 0; for (int i = 0; i < waitToFly.Count; i++) { Debug.Log("Flying"); action = CCMoveToAction.GetSSAction(waitToFly[i], ruler.getDes(waitToFly[i].transform.position), ruler.getSpeed(round) * AnimateSpeed, this); if (i == 0) { addAction(action); } else { addWaitAction(action); StartCoroutine(setNextFly(waitTime, action)); } waitTime += ruler.getIntervals(round); } }
public void FlyUFO(GameObject gameObject, Ruler ruler, int round) { CCMoveToAction action = CCMoveToAction.GetSSAction(gameObject, ruler.getDes(gameObject.transform.position), ruler.getSpeed(round) * AnimateSpeed, this); addAction(action); }