// Use this for initialization void Start() { ui = GetComponent <UIScript>(); rb = GetComponent <Rigidbody>(); gameController = GameObject.Find("Game Controller"); chars = GetComponent <CharactersScript>(); currentCharacter = chars.debug; moveSpeed = currentCharacter.moveSpeed; //Cannot instantiate the icons at the start because it creates a race condition. //The icons are loaded from a different class and can only be instantiated once the other class is loaded. //To solve this, a boolean is used to instantiate the icons on the first frame in the update procedure which runs after start. iconsInitiated = false; playerId = GetComponent <NetworkIdentity>().netId.Value; //Give the player a unique ID based on their network object ID. if (!isLocalPlayer) { //Disable the player camera if this is not the local player. playerCamera.SetActive(false); return; } //Set localPlayer to isLocalPlayer so other scripts can access this property. localPlayer = isLocalPlayer; }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } if (timeLeftText == null) { Debug.LogError("timeLeftText don't added to script", timeLeftText); } if (blocksInAreaScript == null) { Debug.LogError("BlockinArea script don't added", blocksInAreaScript); } if (restartButton == null) { Debug.LogError("Restart button don't added", restartButton); } }
private void Awake() { if (Instance == null) { Instance = this; } }
public void LevelComplete() { _currentLevel++; Achievements.AchievementCheck(); asteroidInfo.SetCurrentAsteroidCount(); UIScript.SetLevelSettings(asteroidInfo.targetAsteroidCount, (int)asteroidInfo.targetChildCount); if (_currentLevel > 10) { RestartAfterTime(0); return; } CustomAnalytics.SendLevelStart(_currentLevel); onLevelComplete.Invoke(); string tag = "Bullet"; if (gameObject.DoesTagExist(tag)) { foreach (GameObject bullet in GameObject.FindGameObjectsWithTag(tag)) { Destroy(bullet); } } CreateAsteroids(); _levelCompleteOneShot = false; }
public UIImage Background; //public so we can disable visibility when not selected... workaround to stop background mouse blocking still happening when panel is hidden public UIGizmoTop100(UIScript script, UIGizmo parent) { Background = script.Create <UIImage>("BackgroundImageTop100Lists"); this.Add(Background); script.LinkMembers(this, true); }
void Awake () { OurUIScript = GetComponent<UIScript> (); OurPlayerSpawner = GameObject.Find("PlayerSpawn").GetComponent<Player> (); enemyGenerator = GameObject.Find("Enemy Generator").GetComponent<EnemyGenerate> (); itemSpawner = GameObject.Find ("Item Spawner").GetComponent<ItemSpawn> (); }
void CheckSelectedTile() { RaycastHit hit; TerrainController terrain = TerrainController.thisTerrainController; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, float.MaxValue, terrainLayer)) { highlighter.Clear(); GridTile tile = GridTile.FindClosestGridTile(hit.point - new Vector3(terrain.tileSize / 2, 0, terrain.tileSize / 2)); if (tile == null) { return; } for (int i = 0; i < 4; i++) { vert[i] = tile.gridNodes[i].position + new Vector3(0, 0.3f, 0); } highlighter.vertices = vert; highlighter.triangles = tri; highlighter.uv = uv; UIScript.GetInstance().SetActiveTile(tile); } highlighter.RecalculateNormals(); GetComponent <MeshFilter>().mesh = highlighter; }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0) && (!UIScript.isPaused())) { GetComponent <Rigidbody2D>().AddForce(Vector2.up * force); } }
// Start is called at the beginning private void Start() { // Find the UI in the scene and store a reference for later use userInterface = GameObject.FindObjectOfType <UIScript>(); audio = GetComponent <AudioSource>(); ui = GameObject.FindObjectOfType <UIScript>(); }
// Update is called once per frame void Update() { if (PersonInteractionScript.ConversationActive || _walkOff || _bounceBack || !_alive) { return; } if (Input.GetButtonDown("Inventory") || (Input.GetKeyDown(KeyCode.I)) && _onGround) { _inventoryOpen = UIScript.Instance().ToggleInventory(transform); } if (!_inventoryOpen) { if (Input.GetButtonDown("Pickup")) { PickUp(); } if (Input.GetKeyDown(KeyCode.T) && !_isRunning && _onGround) { Talk(); } if (Input.GetKeyDown(KeyCode.L) && !_isRunning && _onGround && !_punching) { Punch(); } CheckMovement(); transform.rotation = _rotation; } }
// Use this for initialization private void Start() { playerChoice = GameObject.FindObjectOfType <PlayerChoice>(); if (playerChoice != null) { List <int> temp = new List <int>(); temp.AddRange(playerChoice.choices); choice = temp.ToArray(); Destroy(playerChoice.gameObject); } spawnedPlayers = new List <Player>(); uiScript = GetComponent <UIScript>(); Player.LastCheckpointPosition = Vector3.zero; Player.TeamHealth = maxTeamHealth; Player.HealthRegenerationMultiplicator = healthRegenerationMultiplicator; Player.HealthRegenerationMulitplicatorOnDeath = healthRegenerationMulitplicatorOnDeath; Defeat = false; Win = false; Time.timeScale = 1; GlobalReferences.CurrentGameState = GlobalReferences.GameState.Play; SpawnPlayers(false); }
//Start is called before the first frame update private void Start() { ui = GameObject.FindGameObjectWithTag("UI").GetComponent <UIScript>(); slots = 1; inventory = new List <GameObject>(); usedSlots = inventory.Count; }//End Start
public void ShowAvatarSetting(UIScript ui, AvatarSetting setting) { currentUI = ui; lblAvatarTitle.text = "Avatar Setting"; btnAvatarSettingAdd.gameObject.SetActive(false); btnAvatarSettingOK.gameObject.SetActive(true); btnAvatarSettingCancel.gameObject.SetActive(true); if (setting.AvatarType < 0) { btnAvatarSettingRemove.gameObject.SetActive(false); ifVRMFile.enabled = false; btnVRMFile.enabled = false; } else { btnAvatarSettingRemove.gameObject.SetActive(true); ifVRMFile.enabled = true; btnVRMFile.enabled = true; } btnAvatarSettingApply.gameObject.SetActive(true); ShowSetting(setting); this.gameObject.SetActive(true); }
private void Die() { _animator.SetTrigger("Dead"); _alive = false; _rigidBody.AddForce(new Vector2(0, 8000)); UIScript.Instance().DeadScreen.SetActive(true); }
public void Damage(int damageValue) { currentHealth -= damageValue; if (currentHealth <= 0) { if (gameObject.tag != "Player") //Destroy(gameObject); { if (anim) { anim.SetBool("Dead", true); } UIScript.updateScore(50); Destroy(GetComponent <EnemyNavMovement>()); Destroy(GetComponent <UnityEngine.AI.NavMeshAgent>()); Destroy(GetComponent <CharacterController>()); Destroy(GetComponentInChildren <EnemyAttack>()); GameManager.amountkilled++; } else { Destroy(gameObject); } } }
public UIGizmoPropertyFilters(UIScript script, UIGizmo parent) { Background = script.Create <UIImage>("BackgroundImageFilters"); this.Add(Background); var ui = Content.Content.Get().CustomUI; var commFilter = new UIButton(ui.Get("lotp_community_large.png").Get(GameFacade.GraphicsDevice)); commFilter.ID = "PropertyFilterButton_Community"; var where = parent.GetChildren().First(x => x.ID == "PropertyFilterButton_WhereIveBeen"); commFilter.Position = where.Position - new Microsoft.Xna.Framework.Vector2(1, 3); commFilter.Tooltip = GameFacade.Strings.GetString("f115", "92"); parent.Add(commFilter); where.X += 47; var filterChildren = parent.GetChildren().Where(x => x.ID != null && x.ID.StartsWith("PropertyFilterButton_")).ToList(); foreach (var child in filterChildren) { child.Parent.Remove(child); this.Add(child); ((UIButton)child).OnButtonClick += FilterClicked; } }
void CheckLeftClick() { if (!Input.GetMouseButtonDown(0)) { return; } Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit, Mathf.Infinity)) { GameObject hitObject = hit.collider.gameObject; TurbineController tubineController = hit.transform.GetComponentInParent <TurbineController>(); if (tubineController != null) { UIScript.GetInstance().OpenTurbineMenu(tubineController); } WindVaneController windVaneController = hit.transform.GetComponentInParent <WindVaneController>(); //if (windVaneController != null) // OpenWindVaneMenu(windVaneController); } }
private void Start() { Debug.Log("start"); if (hiddenItemBool) { hiddenItem.SetActive(false); } // Find the UI in the scene and store a reference for later use ui = GameObject.FindObjectOfType <UIScript>(); Debug.Log("28"); // Set the player number based on the GameObject tag switch (gameObject.tag) { case "Player": playerNumber = 0; break; case "Player2": playerNumber = 1; break; default: playerNumber = -1; break; } Debug.Log("42"); // Notify the UI so it will show the right initial amount if (ui != null && playerNumber != -1) { ui.SetHealth(health, playerNumber); } maxHealth = health; //note down the maximum health to avoid going over it when the player gets healed Debug.Log("maxHealth" + maxHealth); }
private void Start() { // Set the player number based on the GameObject tag switch (gameObject.tag) { case "Player": playerNumber = 0; break; case "Player2": playerNumber = 1; break; default: playerNumber = -1; break; } maxHealth = health; //note down the maximum health to avoid going over it when the player gets healed userInterface = FindObjectOfType <UIScript>(); // Notify the UI so it will show the right initial amount if (userInterface != null && playerNumber != -1) { userInterface.SetHealth(health, playerNumber); } }
private void Awake() { quizManager = GameObject.Find("QuizManager").GetComponent <QuizManager>(); panelUserInfo = GameObject.Find("PanelUserInfo").GetComponent <PanelUserInfo>(); uiScript = GameObject.Find("GameObjectUI").GetComponent <UIScript>(); audioSource = quizManager.GetComponent <AudioSource>(); }
void OnTriggerEnter2D(Collider2D otherCollider) { // does the otherCollider have a shot script? ShotScript shot = otherCollider.gameObject.GetComponent <ShotScript>(); if (shot != null) { // destroy the shot Destroy(shot.gameObject); // split sub-asteroids if (splitThis) { for (int i = 1; i <= splitCopies; i++) { asteroidTransform = Instantiate(asteroidPrefab, myTrans.position, Quaternion.identity) as Transform; } } // increment score UIScript uiScript = GameObject.Find("UICanvas").GetComponent <UIScript>(); if (uiScript != null) { uiScript.ScoreAdd(score); } // destroy this asteroid Destroy(gameObject); } }
public static bool ItemSelected(ObjectType type, Transform popup) { if (CraftingWith.Count() > 2) { return(false); // guard } if (CraftingWith.ContainsKey(type)) { CraftingWith[type]++; var index = CraftingWith.Keys.ToList().IndexOf(type); var display = popup.GetChild(0).GetChild(index); display.GetComponentInChildren <Text>().text = CraftingWith[type].ToString(); } else { CraftingWith.Add(type, 1); var display = popup.GetChild(0).GetChild(CraftingWith.Count() - 1); display.GetComponentInChildren <Text>().text = CraftingWith[type].ToString(); display.GetComponentInChildren <Image>().color = new Color(1, 1, 1); display.GetComponentsInChildren <Image>()[1].color = new Color(1, 1, 1, 1); display.GetComponentsInChildren <Image>()[1].sprite = UIScript.Instance().GetCollectableImage(type); } return(true); }
private void InitUI() { Script = this.RenderScript("dressereod.uis"); Background = Script.Create <UIImage>("controlBackgroundPos"); Background.Texture = imageBackgroundDay; AddAt(0, Background); btnDay.OnButtonClick += SetTab; btnSleep.OnButtonClick += SetTab; btnSwim.OnButtonClick += SetTab; btnDecorBack.OnButtonClick += SetTab; btnDecorHead.OnButtonClick += SetTab; btnDecorShoes.OnButtonClick += SetTab; btnDecorTail.OnButtonClick += SetTab; OutfitBrowser = Script.Create <UICollectionViewer>("OutfitBrowser"); OutfitBrowser.PaginationStyle = UIPaginationStyle.NONE; OutfitBrowser.Init(); OutfitBrowser.OnSelectedPageChanged += x => UpdateUIState(); OutfitBrowser.OnChange += x => UpdateUIState(); Add(OutfitBrowser); btnAccept.OnButtonClick += BtnAccept_OnButtonClick; btnDelete.OnButtonClick += BtnDelete_OnButtonClick; var defaultButtons = DefaultButtons; for (var i = 0; i < defaultButtons.Length; i++) { defaultButtons[i].RadioData = i; defaultButtons[i].RadioGroup = "DresserDefault"; defaultButtons[i].OnButtonClick += DefaultRadio_OnButtonClick; } }
public void Damage(int damageValue) { if (IsDead) { return; } currentHealth -= damageValue; if (currentHealth <= 0) { if (gameObject.tag != "Player") { if (anim) { anim.SetBool("Dead", true); } randomSpawnScript.numberSpawned--; StartCoroutine(Despawn()); UIScript.updateScore(50); Destroy(GetComponent <AIScript>()); print("DEAD"); GetComponent <UnityEngine.AI.NavMeshAgent>().isStopped = true; Destroy(GetComponent <UnityEngine.AI.NavMeshAgent>()); Destroy(GetComponent <CharacterController>()); Destroy(GetComponentInChildren <EnemyAttack>()); this.enabled = false; gameObject.name += " (Dead)"; } } }
//private GameObject[] SceneRoots; private void Start() { //SceneRoots = SceneManager.GetSceneByName("Skene1").GetRootGameObjects(); // Find the UI in the scene and store a reference for later use ui = GameObject.FindObjectOfType <UIScript>(); // Set the player number based on the GameObject tag switch (gameObject.tag) { case "Player": playerNumber = 0; break; case "Player2": playerNumber = 1; break; default: playerNumber = -1; break; } // Notify the UI so it will show the right initial amount if (ui != null && playerNumber != -1) { ui.SetHealth(health, playerNumber); } maxHealth = health; //note down the maximum health to avoid going over it when the player gets healed }
public void Damage(int damageValue) { currentHealth -= damageValue; if (currentHealth <= 0) { if (gameObject.tag != "Player") { UIScript.updateScore(30); Destroy(gameObject); } else { currentHealth = 0; gameObject.GetComponent <LookX>().enabled = false; gameObject.GetComponent <ShootingScript>().enabled = false; gameObject.GetComponent <InteractionScript>().enabled = false; gameObject.transform.GetChild(0).GetComponent <LookY>().enabled = false; } } else if (currentHealth > maximumHealth) { currentHealth = maximumHealth; //not over max } }
public void Show(UIScript ui, ConfigurationSetting config) { currentUI = ui; ShowSetting(config); this.gameObject.SetActive(true); }
public UIGizmoTop100(UIScript script, UIGizmo parent) { Background = script.Create <UIImage>("BackgroundImageTop100Lists"); this.Add(Background); script.LinkMembers(this, true); HiddenSubSlider = new UISlider(); Top100SubList.Columns[0].TextureBounds = new Microsoft.Xna.Framework.Vector2(17, 17); Top100SubList.Columns[0].TextureSelectedFrame = 1; Top100SubList.Columns[0].TextureHoverFrame = 2; Top100SubList.OnChange += Top100SubList_OnChange; Top100SubList.AttachSlider(HiddenSubSlider); HiddenSubSlider.AttachButtons(Top100SubListScrollUpButton, Top100SubListScrollDownButton, 1); Top100Slider.AttachButtons(Top100ListScrollUpButton, Top100ListScrollDownButton, 1); Top100ResultList.AttachSlider(Top100Slider); Top100ResultList.Mask = true; Top100ResultList.SetSize(150, 138); Top100ResultList.OnDoubleClick += Top100ResultList_OnDoubleClick; //populateWithXMLHouses(); Top100ResultList.OnDoubleClick += Top100ItemSelect; UpdateCooldown = 100; ListBoxColors = script.Create <UIListBoxTextStyle>("ListBoxColors", Top100ResultList.FontStyle); }
void OnTriggerExit2D(Collider2D obj) { if (obj.gameObject.tag == "Head") { UIScript.upScore(); } }
void Start() { if (instance == null) { instance = this; } }
// Start is called before the first frame update void Start() { flagGameObject = GameObject.FindWithTag("FlagPoleFlag"); flagAnimator = flagGameObject.GetComponent <Animator>(); flagAnimator.enabled = false; ui = GameObject.FindObjectOfType <UIScript>(); }
void Start() { head = Camera.main.GetComponent<StereoController>().Head; originalParent = pauseMenu.transform.parent; buttonText = transform.GetChild (1); buttonText.gameObject.SetActive (false); song = GameObject.FindWithTag("Song"); metronome = FindObjectOfType<MetronomeScript>(); ui = FindObjectOfType<UIScript>(); }
void Awake() { createBoxScript = GetComponent<CreateBoxScript>(); uiScript = GameObject.Find("UI").GetComponent<UIScript>(); score = GameObject.Find("Score").GetComponent<Score>(); scrollingScript = GameObject.Find("2 - Middleground").GetComponent<ScrollingScript>(); adsScript = GetComponent<AdsScript>(); road = GameObject.Find("road"); road1 = GameObject.Find("road1"); }
public PlayerController(int ctrNum, int carNum, int pNum, Transform spawnP, GameObject cam, WorldScript _world) { world = _world; playerNum = pNum; controllerNum = ctrNum; whichCar = carNum; spawnPoint = spawnP; cameraFab = cam; ui = new UIScript(world.UIs[0],ctrNum,this,world.players.Count); //currentChunk = startChunk; initCar(); powerballManager = new PowerballManager(carScript.PowerBall, this); }
// Use this for initialization void Start() { if (UILinkHandler != null) { UIHandler = UILinkHandler.GetComponent<UIScript>(); if (!UIHandler.hasStarted) { UIHandler.Start(); } } if (blueButtonItem != null) { blueButtonCommand = blueButtonItem.GetComponent<CommandParent>(); blueButtonCommand.LinkInput(Color.blue); if (UILinkHandler != null) UIHandler.linkButton(UIScript.UI_BUTTON.BUTTON_BLUE, blueButtonCommand); } if (redButtonItem != null) { redButtonCommand = redButtonItem.GetComponent<CommandParent>(); redButtonCommand.LinkInput(Color.red); if (UILinkHandler != null) UIHandler.linkButton(UIScript.UI_BUTTON.BUTTON_RED, redButtonCommand); } if (yellowButtonItem != null) { yellowButtonCommand = yellowButtonItem.GetComponent<CommandParent>(); yellowButtonCommand.LinkInput(Color.yellow); if (UILinkHandler != null) UIHandler.linkButton(UIScript.UI_BUTTON.BUTTON_YELLOW, yellowButtonCommand); } if (greenButtonItem != null) { greenButtonCommand = greenButtonItem.GetComponent<CommandParent>(); greenButtonCommand.LinkInput(Color.green); if (UILinkHandler != null) UIHandler.linkButton(UIScript.UI_BUTTON.BUTTON_GREEN, greenButtonCommand); } }
public UIPizzaMakerEOD(UIEODController controller) : base(controller) { var script = this.RenderScript("pizzamakereod.uis"); Script = script; background = script.Create<UIImage>("background"); AddAt(0, background); btnIngredient1.ButtonFrames = 3; btnIngredient2.ButtonFrames = 3; btnIngredient3.ButtonFrames = 3; btnIngredient1.Visible = false; btnIngredient2.Visible = false; btnIngredient3.Visible = false; btnIngredient1.OnButtonClick += (UIElement btn) => { SubmitIngredient(0); }; btnIngredient2.OnButtonClick += (UIElement btn) => { SubmitIngredient(1); }; btnIngredient3.OnButtonClick += (UIElement btn) => { SubmitIngredient(2); }; PlaintextHandlers["pizza_show"] = P_Show; PlaintextHandlers["pizza_state"] = P_State; PlaintextHandlers["pizza_time"] = P_Time; PlaintextHandlers["pizza_result"] = P_Result; PlaintextHandlers["pizza_contrib"] = P_Contrib; PlaintextHandlers["pizza_hand"] = P_Hand; PlaintextHandlers["pizza_players"] = P_Players; PersonBG1 = script.Create<UIImage>("playerPos1"); PersonBG2 = script.Create<UIImage>("playerPos2"); PersonBG3 = script.Create<UIImage>("playerPos3"); PersonBG4 = script.Create<UIImage>("playerPos4"); PersonBG1.Texture = imagePlayer; PersonBG2.Texture = imagePlayer; PersonBG3.Texture = imagePlayer; PersonBG4.Texture = imagePlayer; Add(PersonBG1); Add(PersonBG2); Add(PersonBG3); Add(PersonBG4); labelStation1.Alignment = TextAlignment.Left; labelStation2.Alignment = TextAlignment.Left; labelStation3.Alignment = TextAlignment.Left; labelStation4.Alignment = TextAlignment.Left; EnterState(VMEODPizzaState.Lobby); }
public StartScript(UIScript _ui, PlayerController p) { player = p; ui = _ui; contents = new string[3] { "Back to Game", "Leave Track", "Quit" }; actions = new Action[3]{ returnToGame, leaveTrack, quit }; }
// Use this for initialization void Start() { gameTimer = START_TIMER_VAL; countdownTimer = COUNTDOWN_TIMER_VAL; currentState = nextState = GameState.Countdown; ui = GameObject.FindGameObjectWithTag("GUICanvas").GetComponent<UIScript>(); player1 = GameObject.FindGameObjectWithTag("Santa"); player2 = GameObject.FindGameObjectWithTag("Turkey"); player1Stats = player1.GetComponent<ActorStats>(); player2Stats = player2.GetComponent<ActorStats>(); player1.GetComponent<ActorController>().enabled = false; player2.GetComponent<ActorController>().enabled = false; }
public UIScript getUIScript() { if (m_UIScript == null) { m_UIScript = GameObject.Find("Canvas").GetComponent<UIScript>(); } return m_UIScript; }
// Use this for initialization void Start() { UIReference = GameObject.Find("UI"); scoreReference = UIReference.GetComponent<UIScript>(); }
void Awake() { uiScript = GameObject.Find("UI").GetComponent<UIScript>(); }
private void Awake() { Instance = this; }
// Use this for initialization void Start() { player1 = GameObject.Find("Manager").GetComponent<PlayerOneManager>(); player2 = GameObject.Find("Manager").GetComponent<PlayerTwoManager>(); pActions = GameObject.Find ("Manager").GetComponent<ActionManager> (); redXP1 = GameObject.Find ("redXP1"); redXP2 = GameObject.Find ("redXP2"); redXP1.SetActive (false); redXP2.SetActive (false); uiScript = GameObject.Find ("UIScript").GetComponent<UIScript>(); }
public UIGizmoPropertyFilters(UIScript script, UIGizmo parent) { Background = script.Create<UIImage>("BackgroundImageFilters"); this.Add(Background); var filterChildren = parent.GetChildren().Where(x => x.ID != null && x.ID.StartsWith("PropertyFilterButton_")).ToList(); foreach (var child in filterChildren) { child.Parent.Remove(child); this.Add(child); } }
public UILiveMode(UILotControl lotController) { var small800 = (GlobalSettings.Default.GraphicsWidth < 1024) || FSOEnvironment.UIZoomFactor > 1f; var script = this.RenderScript("livepanel"+(small800?"":"1024")+".uis"); Script = script; LotController = lotController; DefaultBGImage = GetTexture(small800 ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002); Background = new UIImage(DefaultBGImage); Background.Y = 35; this.AddAt(0, Background); EODCloseButton.OnButtonClick += EODCloseButton_OnButtonClick; MotivesLabel.CaptionStyle = MotivesLabel.CaptionStyle.Clone(); MotivesLabel.CaptionStyle.Shadow = true; MotivesLabel.Alignment = TextAlignment.Left; MotivesLabel.Position -= new Vector2(0, 5); PeopleListBg = new UIImage(PeopleListBackgroundImg); PeopleListBg.Position = new Microsoft.Xna.Framework.Vector2(375, 38); this.AddAt(1, PeopleListBg); Divider = new UIImage(DividerImg); Divider.Position = new Microsoft.Xna.Framework.Vector2(140, 49); this.AddAt(1, Divider); MoodPanelButton = new UIButton(); MoodPanelButton.Texture = GetTexture((ulong)GameContent.FileIDs.UIFileIDs.lpanel_moodpanelbtn); MoodPanelButton.ImageStates = 4; MoodPanelButton.Position = new Vector2(31, 63); this.Add(MoodPanelButton); MotiveDisplay = new UIMotiveDisplay(); MotiveDisplay.Position = new Vector2(165, 56); this.Add(MotiveDisplay); PersonGrid = new UIPersonGrid(LotController.vm); Add(PersonGrid); PersonGrid.Position = new Vector2(409, 51); if (small800) { PersonGrid.Columns = 4; PersonGrid.DrawPage(); } EODPanel = new UIImage(EODPanelImg); EODPanel.Y = 20; EODPanelTall = new UIImage(EODPanelTallImg); //EODDoublePanelTall = new UIImage(EODDoublePanelTallImg); AddAt(0, EODPanel); AddAt(0, EODPanelTall); //Add(EODDoublePanelTall); EODButtonLayoutNone = script.Create<UIImage>("EODButtonLayoutNone"); EODButtonLayoutNoneTall = script.Create<UIImage>("EODButtonLayoutNoneTall"); EODButtonLayoutOne = script.Create<UIImage>("EODButtonLayoutOne"); EODButtonLayoutOneTall = script.Create<UIImage>("EODButtonLayoutOneTall"); EODButtonLayoutTwo = script.Create<UIImage>("EODButtonLayoutTwo"); EODButtonLayoutTwoTall = script.Create<UIImage>("EODButtonLayoutTwoTall"); EODSubFullLength = script.Create<UIImage>("EODSubFullLength"); EODSubFullLengthTall = script.Create<UIImage>("EODSubFullLengthTall"); EODSubMediumLength = script.Create<UIImage>("EODSubMediumLength"); EODSubMediumLengthTall = script.Create<UIImage>("EODSubMediumLengthTall"); EODSubShortLength = script.Create<UIImage>("EODSubShortLength"); EODSubShortLengthTall = script.Create<UIImage>("EODSubShortLengthTall"); Add(EODButtonLayoutNone); Add(EODButtonLayoutNoneTall); Add(EODButtonLayoutOne); Add(EODButtonLayoutOneTall); Add(EODButtonLayoutTwo); Add(EODButtonLayoutTwoTall); Add(EODSubFullLength); Add(EODSubFullLengthTall); Add(EODSubMediumLength); Add(EODSubMediumLengthTall); Add(EODSubShortLength); Add(EODSubShortLengthTall); EODMsgWinLong = script.Create<UIImage>("EODMsgWinLong"); EODMsgWinShort = script.Create<UIImage>("EODMsgWinShort"); EODTimer = script.Create<UIImage>("EODTimer"); AddAt(0, EODTimer); AddAt(0, EODMsgWinLong); AddAt(0, EODMsgWinShort); EODButton = new UIButton(EODButtonImg); Add(EODButton); EODButton.OnButtonClick += EODToggle; EODImage = script.Create<UIImage>("EODButtonImageSize"); Add(EODImage); NextPageButton.OnButtonClick += (UIElement btn) => { PersonGrid.NextPage(); }; DefaultNextPagePos = NextPageButton.Position; PreviousPageButton.OnButtonClick += (UIElement btn) => { PersonGrid.PreviousPage(); }; MsgWinTextEntry.Items.Add(new UIListBoxItem("", "")); EODCloseBase = EODCloseButton.Position; EODHelpBase = EODHelpButton.Position; SetInEOD(null, null); }
public UIInboxDropdown() { Script = this.RenderScript("messageinboxmenu.uis"); Background = new UIImage(backgroundCollapsedImage); this.AddAt(0, Background); open = true; ToggleOpen(); DropDownButton.OnButtonClick += new ButtonClickDelegate(DropDownButton_OnButtonClick); }
public UIGizmoSearch(UIScript script, UIGizmo parent) { Background = script.Create<UIImage>("BackgroundImageSearch"); this.Add(Background); script.LinkMembers(this, true); SearchText.CurrentText = "127.0.0.1"; NarrowSearchButton.OnButtonClick += JoinServerLot; }
// Use this for initialization void Start() { energyRefresh = energyRefreshRateInSeconds*60; EnergyReference = UIReference.GetComponent<UIScript>(); }
public UIGizmoTop100(UIScript script, UIGizmo parent) { Background = script.Create<UIImage>("BackgroundImageTop100Lists"); this.Add(Background); script.LinkMembers(this, true); Top100Slider.AttachButtons(Top100ListScrollUpButton, Top100ListScrollDownButton, 1); Top100ResultList.AttachSlider(Top100Slider); populateWithXMLHouses(); Top100ResultList.OnDoubleClick += Top100ItemSelect; UpdateCooldown = 100; }
public UIImage Background; //public so we can disable visibility when not selected... workaround to stop background mouse blocking still happening when panel is hidden #endregion Fields #region Constructors public UIGizmoTop100(UIScript script, UIGizmo parent) { Background = script.Create<UIImage>("BackgroundImageTop100Lists"); this.Add(Background); script.LinkMembers(this, true); }
public UIGizmoSearch(UIScript script, UIGizmo parent) { Background = script.Create<UIImage>("BackgroundImageSearch"); this.Add(Background); script.LinkMembers(this, true); }
// Use this for initialization void Start() { model = transform.GetComponent<PlayerModel>(); gui = GameObject.Find("GUIObj").GetComponent<UIScript>(); }
// Use this for initialization void Start() { uiscript = (UIScript)GameObject.FindGameObjectWithTag ("MainCamera").GetComponent ("UIScript"); falconSpawnPoint = new Transform[falconSpawns.childCount]; int i = 0; foreach (Transform theSpawnPoint in falconSpawns) { falconSpawnPoint [i] = theSpawnPoint; i++; } i = 0; tankSpawnPoint = new Transform[tankSpawns.childCount]; foreach (Transform theSpawnPoint in tankSpawns) { tankSpawnPoint[i] = theSpawnPoint; i++; } SetNextWave (); StartNewWave (); Time.timeScale = 1; Screen.sleepTimeout = (int)SleepTimeout.NeverSleep; winnerPanel.Play (false); /*Debug.Log("Animation.count="+ waveCompletedSprite.GetClipCount()); i =1; foreach (AnimationState clip in waveCompletedSprite) {Debug.Log ("!!!!"+i.ToString()+" "+clip.name); i++; }*/ //waveCompletedSprite.Play (); }
// Use this for initialization void Start() { otherScript = GetComponent<UIScript>(); }
// Use this for initialization void Start() { inventory = GameObject.Find("Inventory").GetComponent<InventarScript>(); ui = GameObject.Find ("GUI").GetComponent<UIScript> (); if(tod == null) tod = GameObject.Find ("TOD").GetComponent<TOD> (); lastTimeFish = -1F; }
// Use this for initialization void Awake() { instance = this; coinText = coinText.GetComponent<Text>(); levelText = levelText.GetComponent<Text>(); }
void Start() { player1 = GameObject.Find ("Manager").GetComponent<PlayerOneManager>(); player2 = GameObject.Find ("Manager").GetComponent<PlayerTwoManager>(); pActions = GameObject.Find ("Manager").GetComponent<ActionManager>(); playerOneSprite = GameObject.FindGameObjectWithTag("player1").transform; playerTwoSprite = GameObject.FindGameObjectWithTag ("player2").transform; //pos1 - pos5 = player one grid left to right pos1 = GameObject.FindGameObjectWithTag ("position1").transform; pos2 = GameObject.FindGameObjectWithTag ("position2").transform; pos3 = GameObject.FindGameObjectWithTag ("position3").transform; pos4 = GameObject.FindGameObjectWithTag ("position4").transform; pos5 = GameObject.FindGameObjectWithTag ("position5").transform; //pos6 - pos10 = player two grid left to right pos6 = GameObject.FindGameObjectWithTag ("position6").transform; pos7 = GameObject.FindGameObjectWithTag ("position7").transform; pos8 = GameObject.FindGameObjectWithTag ("position8").transform; pos9 = GameObject.FindGameObjectWithTag ("position9").transform; pos10 = GameObject.FindGameObjectWithTag ("position10").transform; uiScript = GameObject.Find ("UIScript").GetComponent<UIScript>(); spriteRendererP1 = GameObject.Find("Player1").GetComponent<SpriteRenderer>(); spriteRendererP2 = GameObject.Find ("Player2").GetComponent<SpriteRenderer>(); Debug.Log ("Player1 Action Points: " + player1.playerOneActionPoints); Debug.Log ("Player2 Action Points: " + player2.playerTwoActionPoints); }
void Start() { player1 = GameObject.Find ("Manager").GetComponent<PlayerOneManager>(); player2 = GameObject.Find ("Manager").GetComponent<PlayerTwoManager>(); uiScript = GameObject.Find ("UIScript").GetComponent<UIScript>(); }
/// <summary> /// Generates & plumbs in UI from UI script /// </summary> /// <param name="uiScript"></param> public UIScript RenderScript(string uiScript) { var path = Path.Combine(GlobalSettings.Default.StartupPath, @"gamedata\uiscripts\" + uiScript); var script = new UIScript(GameFacade.GraphicsDevice, this); script.Parse(path); return script; }