Ejemplo n.º 1
0
 void InitScripts()
 {
     if (materialController == null)
     {
         materialController = GameObject.Find("MaterialObject").GetComponent <MaterialController>();
     }
 }
 public void RegisterMaterialController(int key, MaterialController controller)
 {
     if (!_materialControllers.ContainsKey(key))
     {
         _materialControllers[key] = controller;
     }
 }
Ejemplo n.º 3
0
        public static async void agua()
        {
            var rnd  = new Random();
            var foto = new Foto
            {
                FotCuidador   = "61C59C6B-C588-42DF-BE78-D35036E6E6CC",
                FotoDescricao = "teste",
                Id            = Guid.NewGuid().ToString(),
                FotoDados     = new byte[50],
            };

            rnd.NextBytes(foto.FotoDados);
            var material = new Material
            {
                MatDescricao  = "algo",
                MatQuantidade = 5,
                MatPacId      = "D1B9FA65-553D-456B-A2B7-1AF77E637981"
            };
            var x = new MaterialController();

            x.Request = new HttpRequestMessage(HttpMethod.Post, Uri.UriSchemeHttps);
            await x.PostMaterial(material);

            //var a = new FotoController();
            //await a.PostFoto(foto);
        }
Ejemplo n.º 4
0
    public override IEnumerator OnEnter()
    {
        yield return(StartCoroutine(base.OnEnter()));

        // search controllers
        var rootObjects = GetRootObjects().ToArray();
        var entities    = rootObjects.First(e => e.name == "Entities");
        var ui          = rootObjects.First(e => e.name == "UICanvas");

        enemyController  = entities.GetComponentInChildren <EnemyController>();
        playerController = entities.GetComponentInChildren <PlayerController>();
        uiController     = ui.GetComponent <InGameUIController>();

        // only this class uses MaterialManager
        materialController = new MaterialController();

        // init own class
        Initialize();
        // player process
        InitializePlayerController();
        // enemy process
        InitializeEnemyController();

        // ui process
        uiController.Initialize(GlobalStore.Instance);
        materialController.Add(uiController.Texts);

        yield return(null);
    }
Ejemplo n.º 5
0
        private void btn_salvar_update_material_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MaterialController materialController = new MaterialController();
                Material           mat = materialController.BuscarPorId(Id);
                mat.MaterialNome         = tb_update_nome_material.Text;
                mat.MaterialDesc         = tb_update_desc_material.Text;
                mat.QuantidadeCadastrada = tb_update_qtde_material.Text;

                if (string.IsNullOrEmpty(tb_update_nome_material.Text))
                {
                    throw new NullReferenceException("O campo nome é obrigatório.");
                }
                if (string.IsNullOrEmpty(tb_update_desc_material.Text))
                {
                    throw new NullReferenceException("O campo descrição é obrigatório.");
                }
                if (string.IsNullOrEmpty(tb_update_qtde_material.Text))
                {
                    throw new NullReferenceException("O campo quantidade é obrigatório.");
                }
                materialController.Atualizar(mat);
                MessageBox.Show("Material salvo com sucesso!");

                ListaMateriais dg_listarMateriais = new ListaMateriais();
                dg_listarMateriais.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro ao atualizar material! (" + ex.Message + ")");
            }
        }
Ejemplo n.º 6
0
    public void                     OnStart()
    {
        if (Material == null || _started)
        {
            return;
        }

        _started = true;
        _backup  = new MaterialController();

        // Backup settings in a temp controller
        _backup._diffuseColor    = Material.GetColor("_Color");
        _backup._diffuseTexture  = Material.GetTexture("_MainTex");
        _backup._emissionColor   = Material.GetColor("_EmissionColor");
        _backup._emissionScale   = 1;
        _backup._emissiveTexture = Material.GetTexture("_EmissionMap");
        _backup._normalMap       = Material.GetTexture("_BumpMap");
        _backup._normalStrength  = Material.GetFloat("_BumpScale");

        // Register this controller with the game scene manager using material instance ID. The GameScene manager will reset
        // all registered materials when the scene closes
        if (GameSceneManager.instance)
        {
            GameSceneManager.instance.RegisterMaterialController(Material.GetInstanceID(), this);
        }
    }
 public void RegisterMaterialController(int key, MaterialController materialController)
 {
     if (!_materialControllers.ContainsKey(key))
     {
         _materialControllers.Add(key, materialController);
     }
 }
    public MaterialController GetMaterialController(int key)
    {
        MaterialController materialController = null;

        _materialControllers.TryGetValue(key, out materialController);
        return(materialController);
    }
Ejemplo n.º 9
0
        public void loadCombos()
        {
            this.controller = new MaterialController();
            Dictionary <Object, dynamic> resultMaterials = this.controller.getMaterials();
            Dictionary <Object, dynamic> resultTypes     = this.controller.getMaterialTypes();
            Dictionary <Object, dynamic> resultProviders = this.controller.getAllProviders();
            Dictionary <Object, dynamic> resultStatus    = this.controller.getAllStatus();

            if (resultMaterials["code"] == Result.Failed ||
                resultTypes["code"] == Result.Failed ||
                resultProviders["code"] == Result.Failed ||
                resultStatus["code"] == Result.Failed)
            {
                MessageBox.Show(resultTypes["msg"]);
                return;
            }

            if (resultMaterials["code"] == Result.Processed &&
                resultTypes["code"] == Result.Processed &&
                resultProviders["code"] == Result.Processed &&
                resultStatus["code"] == Result.Processed)
            {
                loadMaterials(resultMaterials["content"]);
                loadMaterialTypesCombo(resultTypes["content"]);
                loadProvidersCombo(resultProviders["content"]);
                loadStatusComboBox(resultStatus["content"]);
            }
        }
Ejemplo n.º 10
0
 public MaterialList(string user, string passWord)
 {
     this.user     = user;
     this.passWord = passWord;
     mc            = new MaterialController();
     InitializeComponent();
     init();
 }
Ejemplo n.º 11
0
 // initialize terrain
 private void init()
 {
     if (t == null)
     {
         MaterialController.Init();
         t = new GenericTerrain(GetComponent <Transform> ().position, scale, func);
     }
 }
 void SetInitReferences()
 {
     myMaterialController = FindObjectOfType <MaterialController>();
     genearatedObstacles  = new List <GameObject>();
     generatedHiders      = new List <GameObject>();
     generatedSeekers     = new List <GameObject>();
     spawnArea            = GetComponent <Collider>().bounds;
 }
Ejemplo n.º 13
0
        public void Initialize()
        {
            var options = new DbContextOptionsBuilder <Hesabdar.Models.HesabdarContext>()
                          .UseInMemoryDatabase(databaseName: "Add_writes_to_database")
                          .Options;

            context         = new Hesabdar.Models.HesabdarContext(options);
            this.controller = new MaterialController(context);
        }
Ejemplo n.º 14
0
        public MaterialControllerTests()
        {
            _runner = MongoDbRunner.Start();

            var client   = new MongoClient(_runner.ConnectionString);
            var database = client.GetDatabase("IntegrationTest");

            _materialDispositionContext = new DispositionContext(database);
            _sut = new MaterialController(_materialDispositionContext);
        }
        private void btn_SalvarMaterial_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Material mat = new Material();

                //mat.Local_Armazem = (Armazem)this.cbo_armazens.SelectedItem;

                mat.MaterialNome         = tb_NomeMaterial.Text;
                mat.MaterialDesc         = tb_MaterialDesc.Text;
                mat.QuantidadeCadastrada = txt_Quantidade_Cadastrada.Text;

                //var selectedItem = ((Armazem)cbo_armazens.SelectedItem).ArmazemId;
                //var item = cbo_armazens.SelectedItem as Armazem;



                //mat.Local_Armazem = cbo_armazens
                //mat.Local_Armazem = cbo_armazens.SelectedItem.ToString;
                //var selectedItem = cbo_armazens.SelectedItem;

                //ComboBoxItem cbi = cbo_armazens.ItemContainerGenerator.ContainerFromItem(selectedItem) as ComboBoxItem;

                MaterialController materialController = new MaterialController();
                if (string.IsNullOrEmpty(tb_NomeMaterial.Text))
                {
                    throw new NullReferenceException("O campo nome é obrigatório.");
                }

                if (string.IsNullOrEmpty(tb_MaterialDesc.Text))
                {
                    throw new NullReferenceException("O campo descrição é obrigatório.");
                }

                if (string.IsNullOrEmpty(txt_Quantidade_Cadastrada.Text))
                {
                    throw new NullReferenceException("O campo quantidade é obrigatório.");
                }



                materialController.Adicionar(mat);
                MessageBox.Show("Material salvo com sucesso!");
                this.Close();


                ListaMateriais dg_ListaMateriais = new ListaMateriais();
                dg_ListaMateriais.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro ao salvar o usuário (" + ex.Message + ")");
            }
        }
Ejemplo n.º 16
0
    void Start()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
            return;
        }

        _instance = this;
        DontDestroyOnLoad(this.gameObject);
    }
Ejemplo n.º 17
0
        private void InitModules()
        {
            // init everything here so they don't need to be instantiated later
            VoronoiNoise.Init();
            MaterialController.Init();
            TextureController.Init();
            OptController.Init();
            Seeder.Init(islandDensity);

            method = Constants.NoiseFuncs [(int)noiseType];
        }
 public void SetMaterial(MaterialController matController, Material material)
 {
     this.material    = material;
     audioSource.clip = buttonClick;
     audioSource.Play();
     if (materialController != null)
     {
         materialController.ResetMaterial();
     }
     materialController = matController;
 }
Ejemplo n.º 19
0
        private void btnSendInfo_Click(object sender, EventArgs e)
        {
            if (catchData())
            {
                storeDataIntoArray();

                MaterialController controller = new MaterialController();
                controller.data = this.data;
                Dictionary <Object, dynamic> result = controller.insertMaterial();
                MessageBox.Show(result["msg"]);
            }
        }
Ejemplo n.º 20
0
 void Update()
 {
     content.text = string.Format(text,
                                  QSystemController.currentQuantumSystem.potentialLabel,
                                  MaterialController.ShaderLabel(),
                                  QSystemController.currentQuantumSystem.length,
                                  QSystemController.currentQuantumSystem.mass,
                                  WaveFunction.expectedEnergy,
                                  runMode.time,
                                  QSystemController.currentQuantumSystem.potentialMin,
                                  QSystemController.currentQuantumSystem.potentialMax);
 }
        private async void BtnAddMaterial_Clicked(object sender, EventArgs e)
        {
		if(!Validate()){
				await DisplayAlert($"Ocorreu um erro!","Alguns campos nulos não são aceitos.", "OK");
				return;
		}
			try {
				Material material = new Material(MaterialEntry.Text, DescritionEntry.Text);
				CallbackStatus status = await MaterialController.AddAPI(material);
				await DisplayAlert($"{ status.CurrentStatus.CallbackStatusToText()}", status.CallbackMessage, "OK");
			}
			catch{ await DisplayAlert($"Ocorreu um erro ao adicionar novo material!", "Tente novamente mais tarde.", "OK"); }
		}
Ejemplo n.º 22
0
        private void btnDelete_Material_Click(object sender, RoutedEventArgs e)
        {
            int id = (dg_ListaMateriais.SelectedItem as Material).MaterialId;
            MaterialController matController = new MaterialController();

            matController.Excluir(id);
            MessageBox.Show("Material excluido com Sucesso!");

            ListaMateriais dg_listamateriais = new ListaMateriais();

            dg_listamateriais.Show();
            this.Close();
        }
Ejemplo n.º 23
0
 private void OnEnable()
 {
     if (this._isInitialized)
     {
         return;
     }
     this._materialController = base.GetComponentInChildren <MaterialController>();
     this._camera             = base.GetComponent <Camera>();
     if (this._materialController != null && this._camera != null)
     {
         this._isInitialized = true;
         this._materialController.isRealtimeUpdate = true;
     }
 }
Ejemplo n.º 24
0
    public void Init(PreviewScreenView view,
                     CameraZoomController zoomController,
                     GameStateMachine sm,
                     IModelLoader loader,
                     MaterialController materialController)
    {
        this.uiView             = view;
        this.sm                 = sm;
        this.zoomController     = zoomController;
        this.loader             = loader;
        this.materialController = materialController;

        view.BackClicked.AddListener(() => sm.ChangeState <ListGameState>());
    }
Ejemplo n.º 25
0
 public void HideLightEffect()
 {
     if (this.skinnedMeshRenderers.Count <= 0)
     {
         return;
     }
     this.skinnedMeshRenderers.ForEach(i =>
     {
         MaterialController.CancelSetLightMaterial(i);
         MaterialController.CancelSetMaterial(i, CustomShader.OUTLINE_GLOW);
         MaterialController.CancelSetMaterial(i, CustomShader.Edge_GLOW);
     });
     this.skinnedMeshRenderers.Clear();
 }
Ejemplo n.º 26
0
        private async Task <int> SetMaterials()
        {
            try {
                Materials = new MultiSelectObservableCollection <Material>();
                List <Material> MaterialsApi = await MaterialController.GetAllAPI();

                foreach (Material material in MaterialsApi)
                {
                    Materials.Add(material);
                }

                lvwMaterials.ItemsSource = Materials;
            } catch { await DisplayAlert("Ocorreu um erro ao tentar obter a lista de materiais!", "Tente novamente mais tarde.", "OK"); }
            return(0);
        }
Ejemplo n.º 27
0
    void UpdateColours()
    {
        MaterialController.SetGradient(oldColourScheme.gradient, colourScheme.gradient, LerpAmount);
        Random.State oldState = Random.state;
        Random.InitState(0);
        float diff = 1f / tunnles.Count;

        for (int i = 0; i < tunnles.Count; i++)
        {
            float f = (float)i / tunnles.Count;
            tunnles[i].SetColour(oldColourScheme, colourScheme, f, diff, twistAdjust, offsetAdjust);
            //tunnles[i].SetColour(colourScheme.gradient, f, diff);
        }
        Random.state = oldState;
    }
Ejemplo n.º 28
0
 void ViewUpdate()
 {
     float[,] coefficients = new float[WaveFunction.NumberOfStates, 2];
     for (int i = 0; i < WaveFunction.NumberOfStates; i++)
     {
         coefficients[i, 0] = 0.0f;
         coefficients[i, 1] = 0.0f;
         if (i == viewStateIndex)
         {
             coefficients[i, 0] = 1.0f;
         }
     }
     WaveFunction.SetCoefficients(coefficients);
     MaterialController.ResetScale(QSystemController.currentQuantumSystem.MaxStateValue(viewStateIndex));
     WaveFunction.UpdateRender();
 }
Ejemplo n.º 29
0
        public void loadCombos()
        {
            this.controller = new MaterialController();
            Dictionary <Object, dynamic> resultMaterials = this.controller.getMaterials();

            if (resultMaterials["code"] == Result.Failed)
            {
                MessageBox.Show(resultMaterials["msg"]);
                return;
            }

            if (resultMaterials["code"] == Result.Processed)
            {
                loadMaterials(resultMaterials["content"]);
            }
        }
Ejemplo n.º 30
0
    public void ShowOutlineGlow()
    {
        this.skinnedMeshRenderers.AddRange(this.GetSkinnedMeshRenderer(this.transform).ToArray());
        if (this.skinnedMeshRenderers.Count <= 0)
        {
            return;
        }
        Hashtable shaderParams = new Hashtable();

        shaderParams.Add("_Color", _Color);
        shaderParams.Add("_Cutoff", _Cutoff);
        shaderParams.Add("_Power", _Power);
        this.skinnedMeshRenderers.ForEach(i =>
        {
            MaterialController.SetLightMaterial(i, CustomShader.OUTLINE_GLOW, shaderParams);
        });
    }
Ejemplo n.º 31
0
 // setController
 public void setController(MaterialController controller)
 {
     _controller = controller;
     materialsListBox.DataSource = controller.materials;
 }
Ejemplo n.º 32
0
 void InitScripts()
 {
     if(materialController==null){
         materialController=GameObject.Find ("MaterialObject").GetComponent<MaterialController>();
     }
 }
Ejemplo n.º 33
0
        public void initialize()
        {
            // Initialize graphics device service
            _graphicsDeviceService = GraphicsDeviceService.AddRef(view.Handle, view.Width, view.Height);

            // Initialize core resource controller
            ResourceManager.initialize(_graphicsDeviceService.GraphicsDevice);
            ResourceManager.rootDirectory = resourcesSourcePath + "\\";

            // Create controllers
            _levelController = new LevelController(this, _editorView.levelView);
            _materialController = new MaterialController(this, _editorView.materialView);
            _blueprintController = new BlueprintController(this, _editorView.blueprintView);
            _circuitController = new CircuitController(this, _editorView.circuitsView);
            _backgroundController = new BackgroundController(this, _editorView.backgroundView);
        }