// Use this for initialization void Start() { // get cubeData string jsonString = CubeData.GetCubeData(); CubeEffectDataParser cubeDataParser = new CubeEffectDataParser(); _cubeEffectData = cubeDataParser.Deserialize(jsonString); Debug.Log(_cubeEffectData.AnimationDelay + " ::" + _cubeEffectData.AnimationDuration + "::" + _cubeEffectData.CubeLifetime); transform.position = _pointA.position; StartCoroutine(WaitAndSetMove()); StartCoroutine(DestroyAfterDuration()); _speed = Vector3.Distance(_pointA.position, _pointB.position) / _cubeEffectData.AnimationDuration; }