/// <summary> /// Start the tweening operation. /// </summary> static public TweenVoxel2 Begin(GameObject go, float duration, VoxelProperty prop) { TweenVoxel2 comp = Tween.Begin <TweenVoxel2>(go, duration); comp.from = comp.property; comp.to = prop; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
public void emission() { VoxelProperty prop = new VoxelProperty(); this._voxel.color = beginColor_; this.transform.localScale = this.beginScale_; prop.color = endColor_; prop.position = this.transform.position + director_ * speed_ * time_; prop.scale = this.endScale_; Tween tween = TweenVoxel2.Begin(this.gameObject, time_, prop); tween.method = this.method_; tween.onFinished = delegate { this.gameObject.SetActive(false); }; }