示例#1
0
    public void emission(VoxelMesh mesh, int count = 80, GDGeek.Tween.Method method = GDGeek.Tween.Method.easeOutQuad)
    {
        for (int i = 0; i < count; ++i)
        {
            GameObject obj   = _pool.create();
            Voxel      voxel = obj.GetComponent <Voxel>();
            obj.SetActive(true);

            VoxelProperty begin = new VoxelProperty();
            begin.color    = RandomColor(mesh);
            begin.position = RandomPosition(mesh);
            begin.scale    = Vector3.one * 2.0f;

            VoxelProperty end = new VoxelProperty();
            end.color    = begin.color;
            end.position = begin.position + Random.insideUnitSphere * 100.0f;
            end.scale    = Vector3.one * 4.0f;

            voxel.property = begin;
            Tween tween = TweenVoxel.Begin(obj, Random.Range(0.5f, 0.9f), end);
            tween.method     = method;
            tween.onFinished = delegate {
                obj.SetActive(false);
            };
        }
    }
示例#2
0
 public VoxelProperty mul(float f)
 {
     VoxelProperty ret = new VoxelProperty();
     ret.position = this.position * f;
     ret.color = this.color * f;
     ret.scale = this.scale * f;
     return ret;
 }
示例#3
0
 public VoxelProperty add(VoxelProperty prop)
 {
     VoxelProperty ret = new VoxelProperty();
     ret.position = this.position + prop.position;
     ret.color = this.color + prop.color;
     ret.scale = this.scale + prop.scale;
     return ret;
 }
示例#4
0
    public VoxelProperty add(VoxelProperty prop)
    {
        VoxelProperty ret = new VoxelProperty();

        ret.position = this.position + prop.position;
        ret.color    = this.color + prop.color;
        ret.scale    = this.scale + prop.scale;
        return(ret);
    }
示例#5
0
    public VoxelProperty mul(float f)
    {
        VoxelProperty ret = new VoxelProperty();

        ret.position = this.position * f;
        ret.color    = this.color * f;
        ret.scale    = this.scale * f;
        return(ret);
    }
示例#6
0
文件: TweenVoxel2.cs 项目: gdgeek/fly
        /// <summary>
        /// Start the tweening operation.
        /// </summary>
        public static 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;
        }
示例#7
0
        /// <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);
        }
示例#8
0
        /// <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);
        }
示例#9
0
		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);
			};
		}
示例#10
0
        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);
            };
        }
示例#11
0
 override protected void OnUpdate(float factor, bool isFinished)
 {
     property = from.mul(1f - factor).add(to.mul(factor));
 }
示例#12
0
		override protected void OnUpdate (float factor, bool isFinished){
			property = from.mul(1f - factor).add(to.mul(factor));
		}