示例#1
0
文件: Transformer.cs 项目: gdgeek/fly
 private Task oneTask(Voxel vox, VoxelData to)
 {
     TaskSet task = new TaskSet ();
     TweenTask tt1 = new TweenTask(delegate {
         return TweenVoxel.Begin(vox, 1.0f, to, new Vector3(-1, -4, -0.5f));
     });
     task.push (tt1);
     return task;
 }
示例#2
0
 public override void build(VoxelMesh mesh, Voxel c)
 {
     VoxelEmitter emitter = (VoxelEmitter)GameObject.Instantiate (_emitter);
     emitter.transform.parent = mesh.transform;
     emitter.transform.position = c.transform.position;
     emitter.transform.eulerAngles =c.transform.eulerAngles;
     emitter.gameObject.SetActive (true);
     //emitter.transform = c.transform.rotation;
 }
示例#3
0
文件: TweenVoxel.cs 项目: gdgeek/fly
 /// <summary>
 /// Start the tweening operation.
 /// </summary>
 //13801889517 zhou ping
 public static 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.x + offset.x;//-1;
     comp.to.localPosition.y = to.y + offset.y;//-4;
     comp.to.localPosition.z = to.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;
 }
示例#4
0
 public virtual void build(VoxelMesh mesh, Voxel c)
 {
 }
示例#5
0
 public void Awake()
 {
     if (_voxel == null) {
         _voxel = this.gameObject.GetComponent<Voxel>();
     }
 }
示例#6
0
 public void setup(Voxel vox)
 {
     _vox = vox;
     _vox.setup (position, color, id);
 }