void Start()
 {
     if (!m_menuManager)
     {
         m_menuManager = GameObject.FindGameObjectWithTag("ManagerScene").GetComponent <ManagerMenu>();
     }
 }
Пример #2
0
        private void ImportBtn_Clicked(GUI.GUIItem item)
        {
            if (_GameStarted && _Manager != null)
            {
                MouseUI mouseUI = _Manager.GetComponent <MouseUI>();

                GameObject     tileMap        = mouseUI._ModGet_TileMap();
                Tiles          shipTiles      = tileMap.GetComponent <Tiles>();
                ManagerJobs    managerJobs    = _Manager.GetComponent <ManagerJobs>();
                ManagerMenu    managerMenu    = _Manager.GetComponent <ManagerMenu>();
                ManagerOptions managerOptions = _Manager.GetComponent <ManagerOptions>();

                if (shipTiles != null)
                {
                    String json = System.IO.File.ReadAllText(System.IO.Path.Combine(ModFolder, "Design.json"), Encoding.UTF8);

                    TileData[] tiles = Pathfinding.Serialization.JsonFx.JsonReader.Deserialize <TileData[]>(json);

                    List <TileData> hull     = new List <TileData>();
                    List <TileData> floor    = new List <TileData>();
                    TileData        shipCore = null;
                    List <TileData> other    = new List <TileData>();

                    foreach (TileData td in tiles)
                    {
                        List <TileData.Vec3> StructureParts = new List <TileData.Vec3>();
                        StructureParts.AddRange(td.StructureParts);
                        td.StructureParts = StructureParts;

                        if (td.TileType == "Hull" || td.TileType == "HullCorner")
                        {
                            hull.Add(td);
                        }
                        else if (td.TileType == "Floor")
                        {
                            floor.Add(td);
                        }
                        else if (td.TileType == "ShipCore")
                        {
                            shipCore = td;
                        }
                        else
                        {
                            other.Add(td);
                        }
                    }

                    if (shipCore == null)
                    {
                        throw new Exception("Ship Design is missing required tile ShipCore");
                    }

                    _IsImporting = true;
                    _Manager.GetComponent <ManagerMenu>().toggleMainMenu();
                    managerMenu.StartCoroutine(UpdateTiles(shipTiles, managerJobs, managerOptions, tileMap, hull, floor, shipCore, other));
                    managerMenu.StartCoroutine(OnImportFinished(tiles));
                }
            }
        }
Пример #3
0
 void Awake()
 {
     instance = this;
     managers = new GameObject[transform.childCount];
     for (int p = 0; p < managers.Length; p++)
     {
         managers[p] = transform.GetChild(p).gameObject;
     }
 }
Пример #4
0
 public void Character_one()
 {
     manager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <ManagerMenu>();
     PlayerPrefs.DeleteAll();
     PlayerPrefs.SetInt("CharacterOne", 1);
     manager.isSpawn = false;
     manager.SpawnCharacter(0);
     Debug.Log("1");
 }
Пример #5
0
 public void Character_tree()
 {
     sl3.setSelected = true;
     manager         = GameObject.FindGameObjectWithTag("GameManager").GetComponent <ManagerMenu>();
     PlayerPrefs.DeleteAll();
     PlayerPrefs.SetInt("CharacterThree", 1);
     manager.isSpawn = false;
     manager.SpawnCharacter(2);
     Debug.Log("3");
 }
Пример #6
0
        private static void ProcessManager(IUserRepository userRepo)
        {
            var mgrDetails = userRepo.IsManager(_userId);

            if (mgrDetails.Key)
            {
                IsUserManager = true;
                _department   = mgrDetails.Value;
                System.Console.WriteLine("You are manager of department : " + _department + MainMenu.GetNewLine());
                System.Console.ReadLine();

                var input = ManagerMenu.ShowManagerMenu(UserName, _department);
                while (!string.IsNullOrEmpty(input))
                {
                    switch (input)
                    {
                    case "1":
                        System.Console.WriteLine("You can see the logs @ " + ConfigHelper.GetLogPath());
                        break;

                    case "2":
                        var accessPoints = _AccessPointRepository.Get();
                        foreach (var ap in accessPoints)
                        {
                            System.Console.WriteLine("{0} | {1} | {2}", ap.Id, ap.Name, ap.Facility.Name);
                        }
                        break;

                    case "3":
                        System.Console.WriteLine("To grant user access, enter <AccessPointId> <EmployeeId> <access/manage/monitor>");
                        var data = System.Console.ReadLine().Split(' ');
                        if (data.Length != 3)
                        {
                            System.Console.WriteLine("Invalid details");
                        }
                        else
                        {
                            _AccessPointFacade.InsertUserAccess(data[1], data[0], data[2]);
                        }
                        break;

                    default:
                        System.Console.WriteLine("Invalid input!");
                        break;
                    }
                    System.Console.WriteLine(MainMenu.GetNewLine() + "Press `Enter` to continue..");
                    System.Console.ReadLine();
                    input = ManagerMenu.ShowManagerMenu(UserName, _department);
                }
            }
            else
            {
                IsUserManager = false;
            }
        }
Пример #7
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            //validacion: todos los campos deben estar llenos
            if (userTextbox.Text == "" || passwordTextbox.Text == "")
            {
                MessageBox.Show("Favor de llenar todos los campos");
            }
            else
            {
                //abre conexion a la db
                Connection.OpenConnection();
                //busco el nombre y la contraseña en la db
                MySqlCommand    command = new MySqlCommand(String.Format("SELECT * from Employee WHERE FirstName = '{0}' AND Password = '******' AND Active  = true", userTextbox.Text, passwordTextbox.Text), Connection.myConnection);
                MySqlDataReader reader  = command.ExecuteReader();

                if (reader.Read())
                {
                    //el reader lo ponemos de la forma de employee
                    Class.Employee myEmployee = new Class.Employee(reader.GetInt32(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(4), reader.GetString(5), reader.GetString(6), reader.GetInt32(7), reader.GetBoolean(8));

                    //si coinciden los campos con la informacion del gerente entra aqui
                    if (myEmployee.EmployeeType == 0)
                    {
                        Connection.CloseConnection();
                        MessageBox.Show("Sesion iniciada como admin");

                        //se inicializa el menu del gerente
                        this.Hide();
                        //obtengo el id del empleado y lo mando
                        ManagerMenu ManagerWindow = new ManagerMenu(Connection, myEmployee.IdEmployee);
                        ManagerWindow.ShowDialog();
                        this.Close();
                    }
                    else if (myEmployee.EmployeeType == 1)
                    {
                        //si coinciden los datos con la informacion del cajero entra aqui
                        MessageBox.Show("Sesion iniciada como cajero");
                        Connection.CloseConnection();
                        CashierMenu CashierWIndow = new CashierMenu(Connection, myEmployee.IdEmployee);
                        this.Hide();
                        CashierWIndow.ShowDialog();
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("ID o Contraseña Incorrectos", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                Connection.CloseConnection();
            }
        }
    private void OnEnable()
    {
        if (!m_eventSystem)
        {
            m_eventSystem = GameObject.Find("EventSystem").GetComponent <EventSystem>();
        }
        if (!m_managerMenu)
        {
            m_managerMenu = FindObjectOfType <ManagerMenu>().GetComponent <ManagerMenu>();
        }
        if (!m_canvasAnimator)
        {
            m_canvasAnimator = GameObject.Find("CANVAS_MAIN").GetComponent <Animator>();
        }

        m_changeCanvas            = false;
        m_currentDelay            = 0;
        m_delayBetweenColorChange = 0.7f;
    }
Пример #9
0
    public void OnTest()
    {
        menu = MainCanvas.GetComponent<ManagerMenu>();
        editor = GetComponent<ManagerEdition>();

        GameObject TemaPrueba = CrearTema("Tema Prueba", "Sebastian", new DateTime(2015, 10, 13), null);
        GameObject VRClassroom = CrearTema("VRClassroom", "Andrés Gomez", new DateTime(2015, 06, 13), null);

        menu.Agregar(TemaPrueba);
        menu.Agregar(VRClassroom);

        GameObject SubTema1 = CrearTema("SubTema 1", "Sebastian", new DateTime(2015, 10, 23), TemaPrueba);
        GameObject SubTema2 = CrearTema("SubTema 2", "Sebastian", new DateTime(2015, 10, 23), TemaPrueba);
        GameObject Elemento2a = CrearElemento("Elemento 2a", "Descripcion 2a", SubTema1);
        GameObject Elemento2b = CrearElemento("Elemento 2b", "Descripcion 2b", SubTema1);
        GameObject Elemento2c = CrearElemento("Elemento 2c", "Descripcion 2c", SubTema2);
        GameObject Elemento2d = CrearElemento("Elemento 2d", "Descripcion 2d", SubTema2);

        GameObject Coordenadas = CrearTema("Sistemas de coordenadas", "Sebastian", new DateTime(2015, 10, 23), VRClassroom);
        GameObject Ejemplos = CrearTema("Ejemplos", "Sebastian", new DateTime(2015, 10, 23), VRClassroom);

        GameObject BoxShooter = CrearElemento("Box Shooter", "Un pequeño juego que muestra el funcionamiento basico de Unity", Ejemplos);
        Elemento bs = BoxShooter.GetComponent<Elemento>();
        bs.NombreEjecutable = "BoxShooter";
        bs.SetIcono(IconoBoxShooter);

        GameObject WebPage = CrearElemento("Sistema de coordenadas en Unity", "Documentación de como Unity3D implementa y usa sus sitema de coordenadas", Coordenadas);
        Elemento wp = WebPage.GetComponent<Elemento>();
        wp.NombreEjecutable = "Web_Page_Viewer";
        wp.SetIcono(IconoWebPage);

        GameObject classroom = CrearElemento("Sistema de coordenadas Leccion 1", "Lección de introducción al sistema de coordenadas", Coordenadas);
        Elemento cr = classroom.GetComponent<Elemento>();
        cr.NombreEjecutable = "Classroom";
        cr.SetIcono(IconoClassroom);
    }
Пример #10
0
 void Awake()
 {
     Instance          = this;
     gameManager       = GetComponent <GameManager> ();
     _recordingManager = FindObjectOfType <RecordingManager>();
 }
Пример #11
0
    // Use this for initialization
    void Awake()
    {
        mPrincipal = Principal.GetComponent<ManagerMenu>();
        mDetalle = Detalle.GetComponent<ManagerDetail>();
        Estado = CERRADO;

        mPrincipal.Inicializar();
        mPrincipal.AnchoElementos = GetPrefabWidth();
        mPrincipal.SetParametrosIniciales();
    }
Пример #12
0
 // Use this for initialization
 void Start()
 {
     menu = MainCanvas.GetComponent<ManagerMenu>();
     editor = GetComponent<ManagerEdition>();
 }
Пример #13
0
    public void DataRecovery()
    {
        int tmpLv = level;

        level = 1;
        InstantUpgrade(tmpLv);

        if (unlocked)
        {
            UnLock();
        }

        upgradeText.text = GameController.ConvertScore(upgradeCost) + "\nFon";

        mM = FindObjectOfType <ManagerMenu>();

        if (managed)
        {
            int   multiples  = 0;
            float difference = 0;
            mM.RemoveManager(name);
            System.DateTime now = System.DateTime.Now;
            if (PlayerPrefs.HasKey("LastSecond"))
            {
                int tmpTime  = 0;
                int tmpValue = PlayerPrefs.GetInt("LastYear");

                if (now.Year != tmpValue)
                {
                    tmpTime += 60 * 60 * 24 * 365 * (now.Year - tmpValue);
                }

                tmpValue = PlayerPrefs.GetInt("LastDay");
                if (now.DayOfYear != tmpValue)
                {
                    tmpTime += 60 * 60 * 24 * (now.DayOfYear - tmpValue);
                }

                tmpValue = PlayerPrefs.GetInt("LastHour");

                if (now.Hour != tmpValue)
                {
                    tmpTime += 60 * 60 * (now.Hour - tmpValue);
                }

                tmpValue = PlayerPrefs.GetInt("LastMinute");

                if (now.Minute != tmpValue)
                {
                    tmpTime += 60 * (now.Minute - tmpValue);
                }

                tmpValue = PlayerPrefs.GetInt("LastSecond");

                tmpTime += (now.Second - tmpValue);



                multiples = (int)(tmpTime / cureTime);
                InstantIncrease(multiples);

                difference = (tmpTime) - (multiples * cureTime);
                StartCoroutine(Increase(difference));
                timeLeft = difference;
            }
            else
            {
                timeLeft = 0;
            }
        }
        else
        {
            timeLeft = 0;
        }

        //if (PlayerPrefs.HasKey("Purchased_Upgrades"))
        //{
        //    for(int i=0; i<PlayerPrefs.GetInt("Purchased_Upgrades"); i++)
        //    {
        //        InstantPurchaseUpgrade();
        //    }
        //}

        int upgradesCounter = purchased_upgrades;

        purchased_upgrades = 0;
        for (int i = 0; i < upgradesCounter; i++)
        {
            InstantPurchaseUpgrade();
        }

        gainText.text = "Guadagno: " + GameController.ConvertScore(CalculateCure());


        if (!unlocked)
        {
            img.color      = new Color(0.1f, 0.1f, 0.1f);
            gainText.color = new Color(1, 1, 1, 0);
            timeText.color = new Color(1, 1, 1, 0);
        }
        else
        {
            img.color      = new Color(1f, 1f, 1f);
            gainText.color = new Color(1, 1, 1, 1);
            timeText.color = new Color(1, 1, 1, 1);
        }

        InvokeRepeating("RecalculateTime", 0, 1);
        recovered = true;
        if (timeLeft == 0)
        {
            timeLeft = cureTime;
        }
        //  upgrade_button.SetName(base.name + " Research x 3");
        // upgrade_button.SetCost(purchased_upgrade_cost);
    }