public void SetupGoals() { for (int i = 0; i < levelGoals.Length; i++) { //Create a new goalPanel at the goalIntroParent position GameObject goal = Instantiate(goalIntroPrefab, goalIntroParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalIntroParent.transform); //Set Image and text of the goal GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "" + levelGoals[i].numberNeeded; //Create a new goalPanel at the goalGamePanel position gameGoal = Instantiate(goalPrefab, goalGameParent.transform.position, Quaternion.identity); gameGoal.transform.SetParent(goalGameParent.transform); panel2 = gameGoal.GetComponent <GoalPanel>(); //GoalPanel panel2 = gameGoal.GetComponent<GoalPanel>(); currentGoals.Add(panel2); panel2.thisSprite = levelGoals[i].goalSprite; panel2.thisString = "0/" + levelGoals[i].numberNeeded; } }
void SetupGoals() //настройка вводимых целей { for (int i = 0; i < levelGoals.Length; i++) { //Создаём панель целей в позиции goalIntroParent GameObject goal = Instantiate(goalPrefab, goalIntroParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalIntroParent.transform); //Установим изображение и текст целей GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/" + levelGoals[i].numberNeeded; // Создаём панель целей в позиции goalGameParent GameObject gameGoal = Instantiate(goalPrefab, goalGameParent.transform.position, Quaternion.identity); gameGoal.transform.SetParent(goalGameParent.transform); //Установим изображение и текст целей в игре panel = gameGoal.GetComponent <GoalPanel>(); currentGoals.Add(panel); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/" + levelGoals[i].numberNeeded; } }
void FillGoalList() { foreach (var goal in _currentTierData.goals) { // adjust or add foreach to tip for general tips panel and goals for tier goals GameObject gameObjectTierGoalPanel = Instantiate(tierGoalPanel) as GameObject; GoalPanel goalPanel = gameObjectTierGoalPanel.GetComponent <GoalPanel>(); goalPanel.goalDescription.text = goal.description; gameObjectTierGoalPanel.transform.SetParent(goalSpacer, false); } foreach (var tip in _currentTierData.tips) { GameObject gameObjectTierInfoPanel = Instantiate(tierInfoPanel) as GameObject; InformationPanel InfoPanel = gameObjectTierInfoPanel.GetComponent <InformationPanel>(); InfoPanel.infoDescription.text = tip.description; InfoPanel.infoNumber.text = (_currentTierData.tips.IndexOf(tip) + 1).ToString(); gameObjectTierInfoPanel.transform.SetParent(infoSpacer, false); } }
public void SetupGoals() { for (int i = 0; i < levelGoals.Length; i++) { //create a new goal panel //create game Intro panel GameObject goal = Instantiate(goalPrefab, goalIntroParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalIntroParent.transform); GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thisStirng = "0/" + levelGoals[i].numberNeeded; GameObject goalNewGame = Instantiate(goalPrefab, goalIntroParentNewGame.transform.position, Quaternion.identity); goalNewGame.transform.SetParent(goalIntroParentNewGame.transform); panel = goalNewGame.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thisStirng = "0/" + levelGoals[i].numberNeeded; //create game goal panel GameObject gameGoal = Instantiate(goalPrefab, goalGameParent.transform.position, Quaternion.identity); gameGoal.transform.SetParent(goalGameParent.transform); panel = gameGoal.GetComponent <GoalPanel>(); currentGoals.Add(panel); panel.thisSprite = levelGoals[i].goalSprite; panel.thisStirng = "0/" + levelGoals[i].numberNeeded; } }
public void SetupIntroGoals() { for (int i = 0; i < levelGoals.Length; i++) { // New goal panel at goal intro parent position GameObject goal = Instantiate(goalPrefab, goalIntroPrefav.transform.position, Quaternion.identity); goal.transform.SetParent(goalIntroPrefav.transform); // set imahe and text of the goal GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/" + levelGoals[i].numberNeeded; // new goal panel at goal game parent GameObject gameGoal = Instantiate(goalPrefabSmall, goalGameParent.transform.position, Quaternion.identity); gameGoal.transform.SetParent(goalGameParent.transform); panel = gameGoal.GetComponent <GoalPanel>(); currentGoals.Add(panel); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/" + levelGoals[i].numberNeeded; } }
private GoalPanel setupGoalsPanelWithChildren(GameObject goal, BlankGoal levelGoal) { Image image = null; Text text = null; for (int i = 0; i < goal.transform.childCount; i++) { GameObject currentItem = goal.transform.GetChild(i).gameObject; if (currentItem.GetComponentInChildren <Image>() != null) { image = currentItem.GetComponentInChildren <Image>(); image.sprite = levelGoal.goalSprite; } if (currentItem.GetComponentInChildren <Text>() != null) { text = currentItem.GetComponentInChildren <Text>(); text.text = "0/" + levelGoal.numberNeeded; } } if (image != null && text != null) { GoalPanel goalPanel = new GoalPanel(); goalPanel.image = image; goalPanel.sprite = image.sprite; goalPanel.text = text; goalPanel.textToDisplay = text.text; return(goalPanel); } return(null); }
public void ShowGoalPanel(bool y) { if (y) { GoalPanel.SetActive(true); } else { GoalPanel.SetActive(false); } }
void InitGoal() { for (int i = 0; i < levelGoals.Length; ++i) { GameObject goal = Instantiate(goalPrefab, goalGameParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalGameParent.transform); GoalPanel panel = goal.GetComponent <GoalPanel>(); currentGoals.Add(panel); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0 /" + levelGoals[i].numberNeeded; } }
void SetupGoals() { for (int i = 0; i < levelGoals.Length; i++) { //Create new goal panel at the goalIntroParent position GameObject goal = Instantiate(goalPrefab, goalIntroParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalIntroParent.transform, false); //Set the image and text of the goal GoalPanel panel = setupGoalsPanelWithChildren(goal, levelGoals[i]); //Create new goal panel at the goalGameParent position GameObject gameGoal = Instantiate(goalPrefab, goalGameParent.transform.position, Quaternion.identity); gameGoal.transform.SetParent(goalGameParent.transform, false); panel = setupGoalsPanelWithChildren(gameGoal, levelGoals[i]); currentGoals.Add(panel); } }
public void SetCandiesLeft() { for (int i = 0; i < levelGoals.Length; i++) { GameObject goal = Instantiate(goalPrefab, goalLoseParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalLoseParent.transform); GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = Mathf.Abs(levelGoals[i].numberNeeded - levelGoals[i].numberCollected).ToString(); if (panel.thisString == "1" || panel.thisString == "-1") { panel.thisString = "0"; if (panel.thisString == "-2" || panel.thisString == "-3") { panel.thisString = "0"; } } } }
void SetupGoals() { for (int i = 0; i < levelGoals.Length; i++) { //create new goal panel at the goalintro position GameObject goal = Instantiate(goalPrefab, goalIntroParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalIntroParent.transform); GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/" + levelGoals[i].pointsForGoal; GameObject gameGoal = Instantiate(goalPrefab, goalGameParent.transform.position, Quaternion.identity); gameGoal.transform.SetParent(goalGameParent.transform); panel = gameGoal.GetComponent <GoalPanel>(); currentGoals.Add(panel); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/" + levelGoals[i].pointsForGoal; } }
void SetupGoals() { for (int x = 0; x < levelGoals.Length; x++) { //goalIntroParent yerinde yeni bir Goal Panel yarat. GameObject goal = Instantiate(goalPrefab, goalIntroParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalIntroParent.transform); //Goal'un image ve text'ini yarat. GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[x].goalSprite; panel.thisString = "0/" + levelGoals[x].numberNeeded; //goalGameParent yerinde yeni bir Goal Panel yarat. GameObject gameGoal = Instantiate(goalPrefab, goalGameParent.transform.position, Quaternion.identity); gameGoal.transform.SetParent(goalGameParent.transform); panel = gameGoal.GetComponent <GoalPanel>(); currentGoals.Add(panel); panel.thisSprite = levelGoals[x].goalSprite; panel.thisString = "0/" + levelGoals[x].numberNeeded; } }
void SetUpGoals() { for (int i = 0; i < levelGoals.Length; i++) { //initialiser le panneau de buts du jeu GameObject goal = Instantiate(goalPrefab, goalIntroParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalIntroParent.transform, false); GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/" + levelGoals[i].numberNeeded; //initialiser les buts qui apparaissent dans le jeu en haut à droite GameObject gameGoal = Instantiate(goalPrefab, GoalGameParent.transform.position, Quaternion.identity); gameGoal.transform.SetParent(GoalGameParent.transform, false); panel = gameGoal.GetComponent <GoalPanel>(); currentGoals.Add(panel); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/" + levelGoals[i].numberNeeded; } }
void SetupGoals() { // Loop through all of the level goals in the array for (int i = 0; i < levelGoals.Length; i++) { // Create a new Goal panel at the goal intro parent position GameObject goal = Instantiate(goalPrefab, goalIntroParent.transform.position, Quaternion.identity); goal.transform.SetParent(goalIntroParent.transform); // Set the image and text of the goal: GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/ " + levelGoals[i].numberNeeded; // Create the in game goals GameObject gameGoal = Instantiate(goalPrefab, goalGameParent.transform.position, Quaternion.identity); gameGoal.transform.SetParent(goalGameParent.transform); panel = gameGoal.GetComponent <GoalPanel>(); currentGoals.Add(panel); panel.thisSprite = levelGoals[i].goalSprite; panel.thisString = "0/ " + levelGoals[i].numberNeeded; } }
void SetUpGoals() { for (int i = 0; i < levelGoals.Length; i++) { //create a new Goal Panel at the goal intro panel position GameObject goal = Instantiate(goalPrefab, goalIntroParent.transform.position, Quaternion.identity, goalIntroParent.transform); //set the Image and Text of the goal GoalPanel panel = goal.GetComponent <GoalPanel>(); panel.thisSprite = levelGoals[i].goalSprite; panel.thiString = "0/" + levelGoals[i].numberNeeded; GameObject gameGoal = Instantiate(goalPrefab, goalGameParent.transform.position, Quaternion.identity, goalGameParent.transform); //set the Image and Text of the goal panel = gameGoal.GetComponent <GoalPanel>(); currenGoals.Add(panel); panel.thisSprite = levelGoals[i].goalSprite; panel.thiString = "0/" + levelGoals[i].numberNeeded; } }
private void Awake() { instance = this; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GoalsView)); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.SelectGoalButton = new System.Windows.Forms.ToolStripDropDownButton(); this.DetailsButton = new System.Windows.Forms.ToolStripButton(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.DetailsBrowser = new DeOps.Interface.Views.WebBrowserEx(); this.DiscardButton = new DeOps.Interface.Views.ImageButton(); this.SaveButton = new DeOps.Interface.Views.ImageButton(); MainPanel = new GoalPanel(); this.toolStrip1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.DiscardButton)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.SaveButton)).BeginInit(); this.SuspendLayout(); // // toolStrip1 // this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.SelectGoalButton, this.DetailsButton }); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(594, 25); this.toolStrip1.TabIndex = 20; this.toolStrip1.Text = "toolStrip1"; // // SelectGoalButton // this.SelectGoalButton.Image = ((System.Drawing.Image)(resources.GetObject("SelectGoalButton.Image"))); this.SelectGoalButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.SelectGoalButton.Name = "SelectGoalButton"; this.SelectGoalButton.Size = new System.Drawing.Size(89, 22); this.SelectGoalButton.Text = "Select Goal"; this.SelectGoalButton.DropDownOpening += new System.EventHandler(this.SelectGoal_DropDownOpening); // // DetailsButton // this.DetailsButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.DetailsButton.CheckOnClick = true; this.DetailsButton.Image = ((System.Drawing.Image)(resources.GetObject("DetailsButton.Image"))); this.DetailsButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.DetailsButton.Name = "DetailsButton"; this.DetailsButton.Size = new System.Drawing.Size(59, 22); this.DetailsButton.Text = "Details"; this.DetailsButton.CheckedChanged += new System.EventHandler(this.DetailsButton_CheckedChanged); this.DetailsButton.Click += new System.EventHandler(this.DetailsButton_Click); // // splitContainer1 // this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; this.splitContainer1.Location = new System.Drawing.Point(0, 25); this.splitContainer1.Name = "splitContainer1"; // // splitContainer1.Panel1 // this.splitContainer1.Panel1.Controls.Add(this.MainPanel); // // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.groupBox1); this.splitContainer1.Size = new System.Drawing.Size(594, 353); this.splitContainer1.SplitterDistance = 418; this.splitContainer1.TabIndex = 21; // // MainPanel // this.MainPanel.BackColor = System.Drawing.Color.WhiteSmoke; this.MainPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.MainPanel.Location = new System.Drawing.Point(0, 0); this.MainPanel.Name = "MainPanel"; this.MainPanel.Size = new System.Drawing.Size(418, 353); this.MainPanel.TabIndex = 0; // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Controls.Add(this.DetailsBrowser); this.groupBox1.Location = new System.Drawing.Point(3, 3); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(166, 347); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; this.groupBox1.Text = "Details"; // // DetailsBrowser // this.DetailsBrowser.AllowWebBrowserDrop = false; this.DetailsBrowser.Dock = System.Windows.Forms.DockStyle.Fill; this.DetailsBrowser.IsWebBrowserContextMenuEnabled = false; this.DetailsBrowser.Location = new System.Drawing.Point(3, 16); this.DetailsBrowser.MinimumSize = new System.Drawing.Size(20, 20); this.DetailsBrowser.Name = "DetailsBrowser"; this.DetailsBrowser.ScriptErrorsSuppressed = true; this.DetailsBrowser.Size = new System.Drawing.Size(160, 328); this.DetailsBrowser.TabIndex = 0; // // DiscardButton // this.DiscardButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.DiscardButton.ButtonDown = global::DeOps.Properties.Resources.discard_down; this.DiscardButton.ButtonHot = global::DeOps.Properties.Resources.discard_hot; this.DiscardButton.ButtonNormal = global::DeOps.Properties.Resources.discard_norm; this.DiscardButton.Image = global::DeOps.Properties.Resources.discard_norm; this.DiscardButton.Location = new System.Drawing.Point(511, 384); this.DiscardButton.Name = "DiscardButton"; this.DiscardButton.Size = new System.Drawing.Size(64, 19); this.DiscardButton.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.DiscardButton.TabIndex = 23; this.DiscardButton.TabStop = false; this.DiscardButton.Visible = false; this.DiscardButton.Click += new System.EventHandler(this.DiscardButton_Click); // // SaveButton // this.SaveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.SaveButton.ButtonDown = global::DeOps.Properties.Resources.save_down; this.SaveButton.ButtonHot = global::DeOps.Properties.Resources.save_hot; this.SaveButton.ButtonNormal = global::DeOps.Properties.Resources.save_norm; this.SaveButton.Image = global::DeOps.Properties.Resources.save_norm; this.SaveButton.Location = new System.Drawing.Point(441, 384); this.SaveButton.Name = "SaveButton"; this.SaveButton.Size = new System.Drawing.Size(64, 19); this.SaveButton.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.SaveButton.TabIndex = 22; this.SaveButton.TabStop = false; this.SaveButton.Visible = false; this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); // // GoalsView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.WhiteSmoke; this.Controls.Add(this.DiscardButton); this.Controls.Add(this.SaveButton); this.Controls.Add(this.splitContainer1); this.Controls.Add(this.toolStrip1); this.Name = "GoalsView"; this.Size = new System.Drawing.Size(594, 406); this.Load += new System.EventHandler(this.GoalsView_Load); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.DiscardButton)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.SaveButton)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }