示例#1
0
    void Start()
    {
        breakables     = GetComponentsInChildren <Breakable>();
        breakableLight = GetComponentInChildren <BreakableLight>();
        mainCam        = Camera.main.gameObject.GetComponent <CameraController>();

        stairs = GetComponentInChildren <StairCtrl>();
        if (stairs != null)
        {
            if (stairs.up != null)
            {
                ConnectionDirections.Add(Direction.Up);
            }
            if (stairs.down != null)
            {
                ConnectionDirections.Add(Direction.Down);
            }
        }

        if (!IsStartingRoom)
        {
            Color blackedOut = blackOverlay.color;
            blackedOut.a       = blackoutOpacity;
            blackOverlay.color = blackedOut;
        }
    }
示例#2
0
    public void Travel(Transform obj, bool isGoingUp)
    {
        StairCtrl destination = (isGoingUp) ? up : down;

        if (destination != null)
        {
            StartCoroutine(TravelDelay(obj, destination.transform));
        }
    }
示例#3
0
 public void EnterStairs(StairCtrl stairs, bool canGoUp, bool canGoDown)
 {
     if (currentState == State.ExitingRoom)
     {
         if (desiredDirection == Direction.Up)
         {
             stairs.Travel(transform, true);
         }
         else if (desiredDirection == Direction.Down)
         {
             stairs.Travel(transform, false);
         }
     }
 }
示例#4
0
    public void EnterRoom(Room newRoom)
    {
        currentRoom         = newRoom;
        roomStairs          = currentRoom.GetStairs();
        remainingTimeInRoom = timeInRoom;
        remainingStateTime  = movementStateDuration;
        emotions.SearchRoom(newRoom);

        if (transform.position.x < currentRoom.transform.position.x)
        {
            desiredDirection = Direction.Right;
        }
        else
        {
            desiredDirection = Direction.Left;
        }

        if (currentState != State.Leaving)
        {
            currentState = State.EnteringRoom;
        }
    }