Exemplo n.º 1
0
    void Update()
    {
        if (elevatorArriveCountdown > 0)
        {
            GetComponent <SpriteRenderer>().sprite = elevatorButtonOn;
            elevatorArriveCountdown -= Time.deltaTime;

            if (elevatorArriveCountdown <= 0)
            {
                GetComponent <SpriteRenderer>().sprite = elevatorButtonOff;
                if (callingElevator)
                {
                    elevator.Arrive();
                    elevatorArrived        = true;
                    elevatorCloseCountdown = 3.0f;
                    callingElevator        = false;
                }
            }
        }

        if (elevatorCloseCountdown > 0)
        {
            elevatorCloseCountdown -= Time.deltaTime;

            if (elevatorCloseCountdown <= 0)
            {
                elevatorArrived = false;
                elevator.Close();
                interactive.Activate();
            }
        }
    }
Exemplo n.º 2
0
 private void CheckValue()
 {
     foreach (ChesePiece piece in pieces)
     {
         if (piece.value != requiredValue)
         {
             return;
         }
     }
     interactive.Activate();
     changeSize.Complete();
 }
Exemplo n.º 3
0
 void Update()
 {
     foreach (RoundPuzzle item in items)
     {
         if (item.GetAngle() != 0)
         {
             return;
         }
     }
     interactive.Activate();
     changeSize.Complete();
 }
Exemplo n.º 4
0
    public void Arrive()
    {
        interactive.Activate();
        if (count == 0)
        {
            spriteRenderer.sprite = elevatorFull;
        }
        else
        {
            spriteRenderer.sprite = elevatorEmpty;
        }

        count++;
    }
Exemplo n.º 5
0
 public void CheckValue()
 {
     if (null != balanceItems)
     {
         foreach (BalanceItem item in balanceItems)
         {
             if (item.value != requiredValue)
             {
                 return;
             }
         }
     }
     interactive.Activate();
     changeSize.Complete();
     Debug.Log("Complete");
 }
Exemplo n.º 6
0
    IEnumerator CastLaser()
    {
        yield return(new WaitForSeconds(rotateTime));

        addDoor.Activate();
        //Debug.Log("Draw");
        //设置材质
        laser.material = new Material(Shader.Find("Particles/Additive"));
        //laser.material = laserMat;
        //设置颜色
        laser.startColor = laserColor;
        laser.endColor   = laserColor;
        //设置宽度
        laser.startWidth = laserWidth;
        laser.endWidth   = laserWidth;
        laser.SetPosition(0, generator.position);
        laser.SetPosition(1, target.position);
    }