// Start is called before the first frame update public void Init(PMain _pMain) { m_PMain = _pMain; m_WeaponAnchors[0] = transform.Find("Weapons/Left"); m_WeaponAnchors[1] = transform.Find("Weapons/Right"); m_BeamEffects[0] = transform.Find("Weapons/Laser_Beam_Left").gameObject; m_BeamEffects[1] = transform.Find("Weapons/Laser_Beam_Right").gameObject; m_DefaultTargets[0] = m_WeaponAnchors[0].position; m_DefaultTargets[1] = m_WeaponAnchors[1].position; for (int i = 0; i < 6; i++) { m_PlayerAmmo[i] = PlayerParameters.Instance.m_PlayerWeapons[i].m_Ammo; for (int j = 0; j < 2; j++) { try { m_WeaponModels[j, i] = m_WeaponAnchors[j].GetChild(i).gameObject; } catch { } } } for (int i = 0; i < 2; i++) { m_WeaponAudio[i] = m_WeaponAnchors[i].GetComponent <AudioSource>(); } ChangeWeapon(0, 0); ChangeWeapon(1, 0); }
// Initialize components and some data. public F001_Main(int ID) { InitializeComponent(); this.Icon = Properties.Resources.SoftWorldICO; // Create a material theme manager and add the form to manage (this). MaterialSkinManager materialSkinManager = MaterialSkinManager.Instance; materialSkinManager.AddFormToManage(this); materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; // Configure color schema. materialSkinManager.ColorScheme = new ColorScheme( Primary.BlueGrey900, Primary.Grey900, Primary.Blue500, Accent.LightBlue200, TextShade.WHITE ); uID = ID; Console.WriteLine(ID); pMain = new PMain(this); userLabel.Text = "Welcome, " + pMain.GetUser(ID); defaultHeight = this.Height; defaultWidth = this.Width; // Populate the lists. projects = pMain.GetProjects(); performances = pMain.GetPerformances(); // projectBox.DataSource = projects; projectBox.DisplayMember = "ProjectName"; timeBox.DataSource = new string[] { "all time", "last day", "last week", "last month", "last year", "custom" }; }
// Start is called before the first frame update public void Init(PMain _pMain) { m_PMain = _pMain; m_Camera = SceneCamera.Instance.camera; m_LookValue = new Vector2(m_Camera.transform.localEulerAngles.y, m_Camera.transform.localEulerAngles.x); m_WeaponsAnchor = transform.Find("Weapons"); SceneCamera.Instance.LockCursor(CursorLockMode.Locked); }
// Start is called before the first frame update public void Init(PMain _pMain) { m_PMain = _pMain; m_Mothership = FindObjectOfType <Mothership>(); m_WeaponCharges[0] = SceneCamera.Instance.transform.Find("UI/Reticles/Weapon_Charge_Left").GetComponent <Image>(); m_WeaponCharges[1] = SceneCamera.Instance.transform.Find("UI/Reticles/Weapon_Charge_Right").GetComponent <Image>(); m_HealthBar = SceneCamera.Instance.transform.Find("UI/Health").GetComponent <Image>(); m_AmmoCounters[0] = transform.Find("Ammo_Left").GetComponent <TextMesh>(); m_AmmoCounters[1] = transform.Find("Ammo_Right").GetComponent <TextMesh>(); m_TextSize = m_AmmoCounters[0].characterSize; m_Clock = transform.Find("Clock").GetComponent <TextMesh>(); }
// Refresh the form. private void RefreshForm() { pMain = new PMain(this); userLabel.Text = "Welcome, " + pMain.GetUser(UserID); Permissions = pMain.GetRights(); if (!Permissions.Contains("r1")) { assignButton.Enabled = false; } else { assignButton.Enabled = true; } projectBox.SelectedIndex = 0; timeBox.SelectedIndex = 0; projects = pMain.GetProjects(); performances = pMain.GetPerformances(); projectBox.SelectedIndex = 0; timeBox.SelectedIndex = 0; projectBox.DataSource = projects; mainData.DataSource = new BindingList <PerformanceData>(performances.OrderBy(x => x.ProjectName).ToList()); }
// Start is called before the first frame update public void Init(PMain _pMain) { m_PMain = _pMain; }