void OnTriggerStay(Collider other)
    {
        GameObject target = other.gameObject;

        if (target.name == "MovementWallNorth" || target.name == "MovementWallEast" || target.name == "MovementWallSouth" || target.name == "MovementWallWest")
        {
            moveCamera levelScript = Camera.GetComponent <moveCamera>();
            if (target.name == "MovementWallNorth")
            {
                levelScript.movingDirection = 1;
            }
            else if (target.name == "MovementWallEast")
            {
                levelScript.movingDirection = 2;
            }
            else if (target.name == "MovementWallSouth")
            {
                levelScript.movingDirection = 3;
            }
            else// (target.name == "MovementWallWest")
            {
                levelScript.movingDirection = 4;
            }
        }
    }
Пример #2
0
 private void Start()
 {
     m_characterMove = GetComponent <characterMove>();
     m_moveCamera    = GetComponentInChildren <moveCamera>();
     m_interactor    = GetComponentInChildren <interactor>();
     m_InputData     = new InputData();
 }
    private void OnTriggerExit(Collider other)
    {
        GameObject target = other.gameObject;

        if (target.name == "MovementWallNorth" || target.name == "MovementWallEast" || target.name == "MovementWallSouth" || target.name == "MovementWallWest")
        {
            moveCamera levelScript = Camera.GetComponent <moveCamera>();
            levelScript.movingDirection = 0;
        }
    }