示例#1
0
    void PlayEntrance()
    {
        switch (entranceDirection)
        {
        case EntranceDirection.RIGHT:
            selectedEntrance = entranceRight;
            ballStartAngle   = BallStartAngle.RIGHT;
            break;

        case EntranceDirection.LEFT:
            selectedEntrance = entranceLeft;
            ballStartAngle   = BallStartAngle.LEFT;
            break;

        case EntranceDirection.DOWN:
            selectedEntrance = entranceDown;
            ballStartAngle   = BallStartAngle.DOWN;
            break;

        case EntranceDirection.UP:
            selectedEntrance = entranceUp;
            ballStartAngle   = BallStartAngle.UP;
            break;

        default:
            selectedEntrance = entranceRight;
            ballStartAngle   = BallStartAngle.RIGHT;
            break;
        }

        selectedEntrance.SetActive(true);
        selectedEntrance.GetComponent <Animator>().Play("Entrance");

        Invoke("InitBall", .1f);
    }
示例#2
0
 public void SetStartAngle(BallStartAngle startAngle)
 {
     actualAngle        = (float)startAngle;
     transform.rotation = Quaternion.Euler(0, 0, actualAngle);
 }