상속: MonoBehaviour
예제 #1
0
        private void welcomeRoomtoOfficeNumber(int officeNumber)
        {
            var welcomeRoomToOffice = WelcomeRoom.Where(x => x.OfficeNumber == officeNumber);

            if (WelcomeRoom.Count > 0 && welcomeRoomToOffice != null)
            {
                Visitor visitor = WelcomeRoom.FirstOrDefault();
                WelcomeRoom.Remove(visitor);
                offices[officeNumber].Enter(visitor);
            }
        }
예제 #2
0
        public Visitor Exit()
        {
            Visitor visitor = WelcomeRoom.FirstOrDefault();

            WelcomeRoom.Remove(visitor);
            if (waitingRoom.Count > 0)
            {
                Enter(waitingRoom.Dequeue());
            }
            return(visitor);
        }
예제 #3
0
        //private int[] generateOfficesCapacity(int nOffice)
        //{
        //    random = new Random();
        //    var getCapacities = new int[10];
        //    while (getCapacities.Min() == 0)
        //    {
        //        int maxCap = nOffice;
        //        for (int i = 0; i < getCapacities.Length; i++)
        //        {
        //            getCapacities[i] = random.Next(maxCap);
        //            maxCap -= getCapacities[i];
        //        }
        //    }
        //    return getCapacities;
        //}

        public void Enter(Visitor visitor)
        {
            Office officeToEnter = offices[visitor.OfficeNumber];

            if (officeToEnter.IsThereSpace)
            {
                officeToEnter.Enter(visitor);
                //Console.WriteLine($"Entering office {officeToEnter}");
            }
            else
            {
                WelcomeRoom.Add(visitor);
            }
        }
예제 #4
0
 public void Enter(Visitor visitor)
 {
     if (visitor.Served)
     {
         Console.WriteLine($"I can't believe I finished, priority number {visitor.PriorityNumber}");
     }
     else if (IsThereSpace == false)
     {
         waitingRoom.Enqueue(visitor);
     }
     else if (visitor.PriorityNumber == null)
     {
         visitor.PriorityNumber = GetPriorityNumber;
         GetPriorityNumber++;
         WelcomeRoom.Add(visitor);
     }
 }
예제 #5
0
    public void Initialize()
    {
        const float cameraHeight = 1.5f;

        Vector3 cameraPosition = transform.position;

        cameraPosition.y = cameraHeight;

        // install camera for platform
        if (buildForCardboard)
        {
            Instantiate(cardboardCameraPrefab, cameraPosition, transform.rotation);
            isCardboard = true;

            Cardboard.SDK.EnableSettingsButton = false;

            player = Cardboard.SDK.gameObject;
        }
        else
        {
            player = Instantiate(oculusCameraPrefab, cameraPosition, transform.rotation) as GameObject;
        }

        // get camera's reset position so that it can be reset.
        if (player != null)
        {
            cameraResetPosition = player.transform.position;
        }

        // must create reticle after cameras since it trys to access them
        reticle = Instantiate(reticlePrefab).GetComponent <Crosshair3D>();

        mainScene = Instantiate(mainScenePrefab).GetComponent <WelcomeRoom>();

        mainScene.gameObject.SetActive(isMainScene);

        // add level manager to app
        levelManager = gameObject.AddComponent <LevelManager>();
        levelManager.Initialize(cameraFadeScreenPrefab);
    }
예제 #6
0
    public void Initialize()
    {
        const float cameraHeight = 1.5f;

        // install camera for platform
        if (buildForCardboard)
        {
          Instantiate(cardboardCameraPrefab, new Vector3(0, cameraHeight, 0f), Quaternion.identity);
          isCardboard = true;

          Cardboard.SDK.EnableSettingsButton = false;
        }
        else
        {
          Instantiate(oculusCameraPrefab, new Vector3(0, cameraHeight, 0f), Quaternion.identity);
        }

        // must create reticle after cameras since it trys to access them
        reticle = Instantiate(reticlePrefab).GetComponent<Crosshair3D>();

        mainScene = Instantiate(mainScenePrefab).GetComponent<WelcomeRoom>();

        mainScene.gameObject.SetActive(isMainScene);

        // add level manager to app
        levelManager = gameObject.AddComponent<LevelManager>();
        levelManager.Initialize(cameraFadeScreenPrefab);

        ShowEnvironment(true);
    }
예제 #7
0
    public void Initialize()
    {
        const float cameraHeight = 1.5f;

        Vector3 cameraPosition = transform.position;

        cameraPosition.y = cameraHeight;

        // install camera for platform
        if (buildForCardboard)
        {
          Instantiate(cardboardCameraPrefab, cameraPosition, transform.rotation);
          isCardboard = true;

          Cardboard.SDK.EnableSettingsButton = false;

          player = Cardboard.SDK.gameObject;
        }
        else
        {

          player = Instantiate(oculusCameraPrefab, cameraPosition, transform.rotation) as GameObject;
        }

          // get camera's reset position so that it can be reset.
          if (player != null)
          {
          cameraResetPosition = player.transform.position;
          }

        // must create reticle after cameras since it trys to access them
        reticle = Instantiate(reticlePrefab).GetComponent<Crosshair3D>();

        mainScene = Instantiate(mainScenePrefab).GetComponent<WelcomeRoom>();

        mainScene.gameObject.SetActive(isMainScene);

        // add level manager to app
        levelManager = gameObject.AddComponent<LevelManager>();
        levelManager.Initialize(cameraFadeScreenPrefab);
    }