Example #1
0
 public void Awake()
 {
     if (_voxel == null)
     {
         _voxel = this.gameObject.GetComponent <Voxel_>();
     }
 }
Example #2
0
        private void createVoxel(VoxelHandler handler)
        {
            Voxel_ vox = (Voxel_)GameObject.Instantiate(_prototype);

            vox.transform.SetParent(_root.transform);
            vox.transform.localRotation = Quaternion.LookRotation(Vector3.up);


            handler.setup(vox);
        }
Example #3
0
        /// <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);
        }
Example #4
0
 public void setup(Voxel_ vox)
 {
     //	_vox = vox;
     //	_vox.setup (position, color, id);
 }
Example #5
0
		public void Awake(){
			if (_voxel == null) {
				_voxel = this.gameObject.GetComponent<Voxel_>();		
			}
		}
Example #6
0
	public void setup (Voxel_ vox)
	{
	//	_vox = vox;
	//	_vox.setup (position, color, id);

	}