コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        timeSpawn -= Time.deltaTime;
        if (timeSpawn <= 0f)
        {
            timeSpawn = timeToGrow;
            move.Kill();
            move = this.transform.DOMoveY(finalYPos, _growFireTime);
        }

/*		if(timeSpawn <= 0f){
 *                      timeSpawn = timeToGrow;
 *                      this.transform.localScale = new Vector3(this.transform.localScale.x, this.transform.localScale.y + growFire, this.transform.localScale.z);
 *              }*/
        if (blocks.ReturnMove())
        {
            if (this.transform.position.y <= startYPos)
            {
                move.Kill();
                move = this.transform.DOMoveY(startYPos, _retroceso);

                //this.transform.localScale = new Vector3(this.transform.localScale.x, this.transform.localScale.y - retroceso, this.transform.localScale.z);
                if (blocks.ReturnMove())
                {
                    blocks.ChangeMoved();
                }
            }
        }
    }
コード例 #2
0
    public void resetVar()
    {
        configuracion.rangoMovimientoMin = block.actualFloor.limite.min - 1 - 2;
        configuracion.rangoMovimientoMax = block.actualFloor.limite.max - 2;
        float direccion = isRight?configuracion.rangoMovimientoMax:configuracion.rangoMovimientoMin;

        moveDown = false;
        move     = transform.DOMoveX(direccion, (configuracion.velocidadSeg * Mathf.Abs(this.transform.position.x - direccion)) / 6f).SetEase(Ease.Linear);

        if (block.ReturnMove())
        {
            block.ChangeMoved();
        }
    }