void OnTriggerStay(Collider other) { HUDanim = GameObject.Find("HUDCanvas").GetComponent <Animator>(); description = GameObject.Find("Description").GetComponent <Text>(); Abutton = GameObject.Find("AttackButton").GetComponent <FixedButton>(); if (other.tag == "Player") { if (Abutton.Pressed) { if (GameControl.control.bossbattle == true) { descObj = GameObject.Find("HUDCanvas").GetComponent <HUDVariables>().descObj; descObj.SetActive(false); HUDanim.SetTrigger("Fade"); StartCoroutine(Wait()); } else { description.text = "You are not prepared to meet this foe. Turn back, and gain more experience."; } } } }
// Use this for initialization void Start() { fps = GetComponent <RigidbodyFirstPersonController>(); controlls = GameObject.FindWithTag(Config.TAG_CONTROLS); move = controlls.GetComponentInChildren <FixedJoystick>(); jump = controlls.GetComponentInChildren <FixedButton>(); touch = controlls.GetComponentInChildren <FixedTouchField>(); }
// Start is called before the first frame update void Start() { PV = GetComponent <PhotonView>(); Rigidbody = GetComponent <Rigidbody>(); PA = GetComponent <PlayerActions>(); LeftJoystick = FindObjectOfType <FixedJoystick>(); JumpButton = FindObjectOfType <FixedButton>(); TouchField = FindObjectOfType <FixedTouchField>(); }
public ExerciseControl(T template) { Template = template; AnswerTextBox = new TextBox(); _submitButton = new FixedButton(); #if DEBUG _helpButton = new FixedButton { FlatStyle = FlatStyle.Flat, FlatAppearance = { BorderColor = BackColor, MouseOverBackColor = BackColor, MouseDownBackColor = BackColor } //BackgroundImage = Images.Basic.Question, //BackgroundImageLayout = ImageLayout.Stretch, }; _helpButton.Click += (_, _) => { if (KeyboardUtils.Shift.IsShift) { AnswerTextBox.Text = Template.Result.FirstOrDefault(); if (_submitButton.Enabled) { SubmitButtonOnClick(null, null); } } else { Template.Result.ToConsole(); } }; #endif _submitButton.Click += SubmitButtonOnClick; Controls.Add(AnswerTextBox); Controls.Add(_submitButton); #if DEBUG Controls.Add(_helpButton); #endif HandleCreated += UpdateControls; SizeChanged += UpdateControls; LocationChanged += UpdateControls; }
//static int timesReloaded = 0; //public Animator anim; //public Image black; //public Text lives3; //public Text lives2; //public Text lives1; // Start is called before the first frame update void Start() { if (!cm_cam) { cm_cam = GameObject.Find("ThirdPersonCamera").transform; // this assumes such a camera exists } if (!body) { body = transform.Find("frog"); // this pertains to frog prefab } _jstick = FindObjectOfType <FixedJoystick>(); _jumpbtn = FindObjectOfType <FixedButton>(); _rb = GetComponent <Rigidbody>(); _col = GetComponent <Collider>(); //anim.SetBool("Fade", false); //lives3.gameObject.SetActive(true); //lives2.gameObject.SetActive(false); //lives1.gameObject.SetActive(false); }
/// <summary> /// Called when the element changes. /// </summary> /// <param name="e"></param> protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.View> e) { base.OnElementChanged(e); if (e.OldElement != null) { if (fixedButton != null) { fixedButton.PropertyChanged -= OnPropertyChanged; } } if (e.NewElement != null) { fixedButton = (FixedButton)Element; fixedButton.PropertyChanged += OnPropertyChanged; // Setup native butotn. nativeButton = new Android.Widget.Button(Context); nativeButton.SetOnTouchListener(this); SetNativeControl(nativeButton); SetDefaultValue(); } }
private void InitializeComponent() { SuspendLayout(); ClientSize = new Size(GUILayout.MainFormSizeWidth, GUILayout.MainFormSizeHeight); _githubButton = new WebBrowserButton { Size = new Size(25, 25), Url = ProgramLocalization.ProjectGitHubPage, BackgroundImageLayout = ImageLayout.Stretch, BackgroundImage = Images.Flat.GitHub, }; _githubButton.SetPosition(this, PointOffset.UpRight, 0); _localizationComboBox = new LocalizationComboBox(); _localizationComboBox.SetPosition(_githubButton, PointOffset.Left, 0); _subjectComboBox = new FixedComboBox { DropDownStyle = ComboBoxStyle.DropDownList, }; _subjectComboBox.SetSize(180, ControlSizeType.Width); foreach (SubjectType subject in EnumUtils.GetValuesWithoutDefault <SubjectType>()) { _subjectComboBox.Items.Add(Globals.Localization.Subjects[subject]); } _subjectComboBox.SelectedIndex = 0; _startTestButton = new FixedButton(); _startTestButton.SetSize(125, ControlSizeType.Width); _startTestButton.SetPosition(_subjectComboBox, PointOffset.Right, 0); _startTestButton.Click += StartTestButtonOnClick; _testTab = new TestTab { Appearance = TabAppearance.FlatButtons, BackColor = Color.Black }; _testTab.SetPosition(_subjectComboBox, PointOffset.Down, 0); _testTab.SetSize(ClientSize.Width, ClientSize.Height - _testTab.Location.Y - 20); _testTab.Completed += StopTest; _timerLabel = new FixedLabel { AutoSize = false, ForeColor = Color.Red }; _timerLabel.SetSize(20, ControlSizeType.Height); _timerLabel.SetPosition(0, _testTab.Location.Y + _testTab.Size.Height); _stopTestButton = new FixedButton { Visible = false, Enabled = false }; _stopTestButton.SetSize(120, 20); _stopTestButton.SetPosition(ClientSize.Width - _stopTestButton.Size.Width, _testTab.Location.Y + _testTab.Size.Height); _stopTestButton.Click += StopTestButtonOnClick; _lastGradeLabel = new FixedLabel { AutoSize = false, TextAlign = ContentAlignment.MiddleCenter, ForeColor = Color.Red, Text = @"-", Visible = false }; _lastGradeLabel.SetSize(30, _stopTestButton.Size.Height); _lastGradeLabel.SetPosition(_stopTestButton, PointOffset.Left, 0); _lastGradeTextLabel = new FixedLabel { AutoSize = false, TextAlign = ContentAlignment.MiddleRight, ForeColor = Color.Red, Visible = false }; _lastGradeTextLabel.SetSize(120, _lastGradeLabel.Size.Height); _lastGradeTextLabel.SetPosition(_lastGradeLabel, PointOffset.Left, 0); FormBorderStyle = FormBorderStyle.FixedSingle; MaximizeBox = false; Icon = Resources.Resources.icon; Controls.Add(_githubButton); Controls.Add(_localizationComboBox); Controls.Add(_subjectComboBox); Controls.Add(_startTestButton); Controls.Add(_testTab); Controls.Add(_timerLabel); Controls.Add(_stopTestButton); Controls.Add(_lastGradeLabel); Controls.Add(_lastGradeTextLabel); ResumeLayout(); }
// Start is called before the first frame update void Start() { button = GetComponent <FixedButton>(); }