/// <summary> /// Start the tweening operation. /// </summary> static public TweenVoxel Begin(GameObject go, float duration, VoxelProperty prop) { TweenVoxel tween = Tween.Begin <TweenVoxel>(go, duration); tween.from = tween.property; tween.to = prop; if (duration <= 0f) { tween.Sample(1f, true); tween.enabled = false; } return(tween); }
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 = TweenVoxel.Begin(this.gameObject, time_, prop); tween.method = this.method_; tween.onFinished = delegate { this.gameObject.SetActive(false); }; }
/// <summary> /// Start the tweening operation. /// </summary> //13801889517 zhou ping static public TweenVoxel Begin(Voxel_ vox, float duration, VoxelData to, Vector3 offset) { TweenVoxel comp = Tween.Begin <TweenVoxel>(vox.gameObject, duration); comp.from.localPosition = vox.gameObject.transform.localPosition; // = comp.alpha; comp.from.color = vox.color; comp.vox = vox; comp.to.localPosition.x = to.pos.x + offset.x; //-1; comp.to.localPosition.y = to.pos.y + offset.y; //-4; comp.to.localPosition.z = to.pos.z + offset.z; //-0.5f; comp.to.color = to.color; //comp.to = alpha; /* * if (duration <= 0f) * { * comp.Sample(1f, true); * comp.enabled = false; * }*/ return(comp); }