Esempio n. 1
0
 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;
 }
Esempio n. 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;
 }
Esempio n. 3
0
 /// <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;
 }
Esempio n. 4
0
 public virtual void build(VoxelMesh mesh, Voxel c)
 {
 }
Esempio n. 5
0
 public void Awake()
 {
     if (_voxel == null) {
         _voxel = this.gameObject.GetComponent<Voxel>();
     }
 }
Esempio n. 6
0
 public void setup(Voxel vox)
 {
     _vox = vox;
     _vox.setup (position, color, id);
 }