// Start is called before the first frame update void Start() { message_set = MessageSetScript.message_set; enemymoving = EnemySetfightSceneMoving.enemyset; EnemyObjectSet(enemymoving.objes); set = enemy_parameter_set.set; player = playerStatus.player_status; player.GetComponent <player_colider>().enabled = false; player.GetComponent <playerMoveController>().enabled = false; button.Select(); item_base = ItemDataBase.item_base; ItemGetScript = ItemImageGetScript.item_image_script; foreach (ItemList item in item_base.items) { GameObject g = Instantiate(ItemIcon, Center_objes.transform.position, Quaternion.identity, Center_objes.transform); if (item.image != null) { //g.GetComponent<Image>().sprite = Sprite.Create(item.itemIcon, new Rect(0, 0, item.itemIcon.width, item.itemIcon.height), Vector2.zero); g.GetComponent <Image>().sprite = item.image; } g.GetComponent <ItemIconClickScript>().item = item; } message_set.MessageSet("敵が#{enemy_count}体現れた!"); //foreach() }
void Start() { instance = this; ps = GameObject.FindGameObjectWithTag("Player").GetComponent <playerStatus>(); int[] skillList = null; switch (ps.playerType) { case PlayerType.Magician: skillList = MagicianSkillList; break; case PlayerType.Swordman: skillList = SwordmanSkillList; break; default: break; } for (int i = 0; i < skillList.Length; i++) { GameObject go = GameObject.Instantiate(skillItemPrefab, content); go.GetComponent <skillItem>().getID(skillList[i]); UpdateShow(); } }
void Start() { rb2d = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator> (); speed = GetComponent <playerStatus>().speed; status = GetComponent <playerStatus> (); }
void setUIStatus() { hpBar = transform.Find("hpBar").GetComponent <Slider>(); apBar = transform.Find("apBar").GetComponent <Slider>(); expBar = transform.Find("expBar").GetComponent <Slider>(); hpBarText = transform.Find("hpBar/Text").GetComponent <Text>(); apBarText = transform.Find("apBar/Text").GetComponent <Text>(); expBarText = transform.Find("expBar/Text").GetComponent <Text>(); moneyText = transform.Find("moneyNum/Text").GetComponent <Text>(); GameObject player = GameObject.Find("map").GetComponent <RoundControler> ().player; if (player != null) { pStatus = player.GetComponent <playerStatus> (); HP = pStatus.HP; HPMAX = pStatus.HPMAX; Money = pStatus.Money; AP = pStatus.AP; APMAX = pStatus.APMAX; hpProportion = (float)HP / HPMAX; //Debug.Log (hpProportion); //设值 hpBarText.text = HP + "/" + HPMAX; apBarText.text = AP + "/" + APMAX; moneyText.text = Money + ""; hpBar.value = hpProportion; } }
void Awake() { gerekliNesnelerComponent = GetComponent <gerekliNesneler> (); gameControlComponent = GetComponent <gameControl> (); playerStatusComponent = GetComponent <playerStatus> (); childrenWorkTimeComponent = GetComponent <childrenWorkTime> (); }
private void Start() { instance = this; player_status = GameObject.FindGameObjectWithTag("Player").GetComponent <playerStatus>(); tableRect = this.GetComponent <RectTransform>(); tableRect.localPosition = new Vector3(-1200, 0, 0); }
// Will take the bandanna from the chosenCharacter and give it to the attacking character. public void captureBandanna(GameObject attackedCharacter) { playerStatus playerStatus = GameObject.Find("GridMap").GetComponent <playerStatus>(); playerSelect playerSelect = GameObject.Find("GameCamera").GetComponent <playerSelect>(); GameObject bandanna; string currentCharacter = playerSelect.currentCharacter; if (playerStatus.turn == 1) { // attacking left team bandanna = playerStatus.bandannaLeft; switch (attackedCharacter.name) { case "player1SlotA": playerStatus.leftA.hasBandana = false; giveBandannaToCurrent(bandanna); break; case "player1SlotB": playerStatus.leftB.hasBandana = false; giveBandannaToCurrent(bandanna); break; case "player1SlotC": playerStatus.leftC.hasBandana = false; giveBandannaToCurrent(bandanna); break; default: break; } } else { Debug.Log("42, attackedCharacter.name = " + attackedCharacter.name); bandanna = playerStatus.bandannaRight; switch (attackedCharacter.name) { case "player2SlotA": playerStatus.rightA.hasBandana = false; Debug.Log("48"); giveBandannaToCurrent(bandanna); Debug.Log("50"); break; case "player2SlotB": playerStatus.rightB.hasBandana = false; giveBandannaToCurrent(bandanna); break; case "player2SlotC": playerStatus.rightC.hasBandana = false; giveBandannaToCurrent(bandanna); break; default: break; } } }
void Start() { instance = this; rectTran = this.GetComponent <RectTransform>(); ps = GameObject.FindGameObjectWithTag("Player").GetComponent <playerStatus>(); }
// Use this for initialization void Start() { //component cache saveLoadComponent = GetComponent <saveLoadGameData> (); throwStoneComponent = GetComponent <throwStone> (); childrenWorkTimeComponent = GetComponent <childrenWorkTime> (); playerStatusComponent = GetComponent <playerStatus> (); dialogPanelControlComponent = GetComponent <dialogPanelControl> (); playerLookingAtComponent = GetComponent <playerLookingAt> (); //ana harita kontrolü load ederken var saveLoadComponent.loadPlayerCoordinate(); skyManager = GetComponent <gerekliNesneler> ().SkyManager; player = GetComponent <gerekliNesneler> ().player; playerItemDropPoint = GetComponent <gerekliNesneler> ().itemDropPoint; kamera = GetComponent <gerekliNesneler> ().Kamera; yansimaNesnesi = GetComponent <gerekliNesneler> ().yansimaNesnesi; fps = GetComponent <gerekliNesneler> ().fpsText; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; consolePanelObject.SetActive(false); warningText.text = "<b>Tip:</b> You can press TAB key for the console screen..."; consoleLogText.text = "Hello player! Write <b>h</b> or <b>help</b> for help\n"; Time.timeScale = 1f; consoleInput.onValueChanged.AddListener(delegate { ValueChangeCheck(); }); possibleCommandsWords = new ArrayList(commandDictionary.Length); }
// Use this for initialization void Start() { playerPosition_p = playerPosition.During; canMoving = true; playerStatus_p = playerStatus.Stand; playerMovingType_p = playerMovingType.Stop; }
private void giveBandannaToCurrent(GameObject bandanna) { playerSelect playerSelect = GameObject.Find("GameCamera").GetComponent <playerSelect>(); playerStatus playerStatus = GameObject.Find("GridMap").GetComponent <playerStatus>(); GameObject newParent; GameObject gridObject = GameObject.Find("GridMap"), level0Map = GameObject.Find("Level0Map"); GameObject team1level0Map = GameObject.Find("Level0Map/Teams/player1Team"); GameObject team2level0Map = GameObject.Find("Level0Map/Teams/player2Team"); switch (playerSelect.currentCharacter) { case "A": playerStatus.leftA.hasBandana = true; newParent = GameObject.Find("player1SlotA"); playerStatus.bandannaRight.transform.SetParent(newParent.transform); // need to warp the bandnana as well in each case!!!!!! playerStatus.bandannaRight.transform.position = team1level0Map.transform.Find(newParent.name).position; break; case "B": playerStatus.leftB.hasBandana = true; newParent = GameObject.Find("player1SlotB"); playerStatus.bandannaRight.transform.SetParent(newParent.transform); playerStatus.bandannaRight.transform.position = team1level0Map.transform.Find(newParent.name).position; break; case "C": playerStatus.leftC.hasBandana = true; newParent = GameObject.Find("player1SlotC"); playerStatus.bandannaRight.transform.SetParent(newParent.transform); playerStatus.bandannaRight.transform.position = team1level0Map.transform.Find(newParent.name).position; break; case "A2": playerStatus.rightA.hasBandana = true; newParent = GameObject.Find("player2SlotA"); playerStatus.bandannaRight.transform.SetParent(newParent.transform); playerStatus.bandannaRight.transform.position = team2level0Map.transform.Find(newParent.name).position; break; case "B2": playerStatus.rightB.hasBandana = true; newParent = GameObject.Find("player2SlotB"); playerStatus.bandannaRight.transform.SetParent(newParent.transform); playerStatus.bandannaRight.transform.position = team2level0Map.transform.Find(newParent.name).position; break; case "C2": playerStatus.rightC.hasBandana = true; newParent = GameObject.Find("player2SlotC"); playerStatus.bandannaRight.transform.SetParent(newParent.transform); playerStatus.bandannaRight.transform.position = team2level0Map.transform.Find(newParent.name).position; break; default: break; } return; }
void InputPlayer() { if (InputMgr.vertical >= 0.7f || InputMgr.vertical <= -0.7f) { if (InputMgr.vertical > 0.0f && canMoving == true) { canMoving = false; switch (playerPosition_p) { case playerPosition.Before: playerPosition_p = playerPosition.Before; playerMovingType_p = playerMovingType.Up; break; case playerPosition.During: playerPosition_p = playerPosition.Before; playerMovingType_p = playerMovingType.Up; break; case playerPosition.After: playerPosition_p = playerPosition.During; playerMovingType_p = playerMovingType.Up; break; } playerStatus_p = playerStatus.Moving; } else if (InputMgr.vertical < 0.0f && canMoving == true) { canMoving = false; switch (playerPosition_p) { case playerPosition.Before: playerPosition_p = playerPosition.During; playerMovingType_p = playerMovingType.Down; break; case playerPosition.During: playerPosition_p = playerPosition.After; playerMovingType_p = playerMovingType.Down; break; case playerPosition.After: playerPosition_p = playerPosition.After; playerMovingType_p = playerMovingType.Down; break; } playerStatus_p = playerStatus.Moving; } } if (InputMgr.horizontal != 0.0f) { transform.position += transform.right * InputMgr.horizontal * Time.deltaTime * speed; playerStatus_p = playerStatus.Moving; } if (InputMgr.vertical == 0.0f && InputMgr.horizontal == 0.0f) { playerStatus_p = playerStatus.Stand; } }
public void Reset() { Status = playerStatus.Live; lives = 2; score = 0; ((UI)(GameObjMananger.getInstance().Find(GameObjName.LivesUI))).ChangeText(lives); }
// Start is called before the first frame update void Start() { player_status = playerStatus.player_status; enemy_script = ENemySetBasicScript.enemyscript; EnemySet = enemy_script.gameObject; _button = GetComponent <Button>(); Attack_flow_end(); }
// Start is called before the first frame update void Start() { anim = GetComponent <Animator>(); ps = GetComponent <playerStatus>(); rb = GetComponent <Rigidbody>(); barrier = transform.Find("Barrier").gameObject; positionIndicator = transform.Find("positionIndicator").gameObject; }
void Start() { playerStatusScript = transform.GetComponent <playerStatus>(); levelManagerScript = GameObject.FindGameObjectWithTag("LevelManager").GetComponent <LevelManager>(); enemy = playerStatusScript.enemy; anima = GetComponent <Animation>(); audio = GetComponent <AudioSource>(); }
private void Start() { playerStatus ps = fileManager.loadPlayerStatus(); int totalCoin = ps.coinAmount; int highScore = ps.highScore; totalCoinUI.text = totalCoin.ToString(); highScoreUI.text = highScore.ToString(); }
// Start is called before the first frame update void Awake() { startPosition = transform.position; zoomTimer = 0; done = false; myCm = GetComponent <Camera>(); startOrthographicSize = myCm.orthographicSize; firstTime = false; unZoomTimer = timeToGo; myPlayerStatus = player.GetComponent <playerStatus>(); }
public static void savePlayerStatus(playerStatus ps) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/playerStatus.forward"; FileStream stream = new FileStream(path, FileMode.Create); Debug.Log(path); formatter.Serialize(stream, ps); stream.Close(); }
private void Start() { playerStatus ps = new playerStatus(); // fileManager.savePlayerStatus(ps); instance = this; updateCoinUI(0); updateScoreUI(0); resetPlayerStatus(); }
public int getHighScore() { playerStatus ps = fileManager.loadPlayerStatus(); if (ps.highScore < int.Parse(scoreUI.text)) { return(int.Parse(scoreUI.text)); } else { return(ps.highScore); } }
public void savePlayerStatus() { int coin = getCoinAmount(); int highScore = getHighScore(); playerStatus ps = fileManager.loadPlayerStatus(); ps.coinAmount += coin; ps.highScore = highScore; Debug.Log(ps.highScore); fileManager.savePlayerStatus(ps); }
void Start() { tranform = GetComponent <Transform>(); animator = GetComponent <Animator>(); rigidbody2d = GetComponent <Rigidbody2D>(); audio = GetComponent <AudioSource>(); status = GetComponent <playerStatus>(); //inventoryMG = FindObjectOfType<InventoryMG>(); weapon = GameObject.Find("weapon"); attack = GetComponent <attackInfo>(); weaponInfo = attack.GetWeaponInfo((int)status.FaceTo); skillInfo = attack.GetSkillInfo((int)status.FaceTo); weapon.SetActive(false); }
public async Task CheckStatus() { HttpResponseMessage aResponse = await client.GetAsync(new Uri(this.statusURL)); string[] match = Regex.Split(aResponse.Content.ReadAsStringAsync().Result, @","); if (match.Length > 1) { try { TimeSpan.TryParse(match[3].Substring(2, match[3].Length - 3), out currentTime); TimeSpan.TryParse(match[5].Substring(2, match[5].Length - 3), out totalTime); string interfaceStatus = match[1].Substring(2, match[1].Length - 3); switch (interfaceStatus) { case "Playing": status = playerStatus.PLAYING; break; case "Stopped": status = playerStatus.STOPPED; break; case "Paused": status = playerStatus.PAUSED; break; default: status = playerStatus.STOPPED; break; } volumeMute = int.Parse(match[6]); volumeValue = int.Parse(match[7]); if (filename != null && filename != match[0].Substring(11, match[0].Length - 2)) { this.subtitleDelay = 0; } filename = match[0].Substring(10, match[0].Length - 11); } catch (Exception e) { } } else { this.isConnected = false; } }
private void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag == "Player") { playerStatus w = col.gameObject.GetComponent <playerStatus>(); Vector2 velP = col.gameObject.GetComponent <move>().GetVelocity(); if (imVictoryCollision && Mathf.Abs(velP.x) < minVel && Mathf.Abs(velP.y) < minVel && Mathf.Abs(col.transform.rotation.eulerAngles.z) < minRotate) { w.SetSafeLanding(true); w.SumPoints(myValue * pointsInSafe); } else { w.SetAlive(false); w.SetSafeLanding(false); } } }
public static playerStatus loadPlayerStatus() { playerStatus ps = new playerStatus(); if (!isplayerStatusExists()) { savePlayerStatus(ps); } BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/playerStatus.forward"; FileStream stream = new FileStream(path, FileMode.Open); ps = formatter.Deserialize(stream) as playerStatus; stream.Close(); return(ps); }
public void Update(GameTime gameTime) { currentPlayerStatus = ((Ship)(GameObjMananger.getInstance().Find(GameObjName.Ship))).Status; InputManager.Instance().Update(ScreenManager.Instance().CurrentScreen); if (currentPlayerStatus != playerStatus.Dead && ScreenManager.Instance().CurrentScreen == Screen.Game) { ColPairManager.getInstance().Collide(); GameObjMananger.getInstance().Update(gameTime); TimeEventManager.getInstance().Update(gameTime); AnimationManager.getInstance().Update(gameTime); UpdateHIScore(); } if (currentPlayerStatus == playerStatus.Dead && ScreenManager.Instance().CurrentScreen == Screen.Game) { GAMEOVER(); } }
void Start() { isInAbility = false; originY = transform.position.y; meleeAttackCooldownHolder = meleeAttackCooldown; climaxAnimationSwordHolder = climaxAnimationSword; originY = transform.position.y; highestLineIndex = (amountOfLines - 1) / 2; lowestLineIndex = highestLineIndex - (amountOfLines - 1); playerStatus = GetComponent <playerStatus>(); if (amountOfLines % 2 == 0) //Check if odd or even -> If even adjust Index { highestLineIndex = (float)Math.Floor(highestLineIndex); lowestLineIndex = (float)Math.Floor(lowestLineIndex); } }
private void OnCollisionStay(Collision collision) { if (collision.gameObject.CompareTag("Player")) { GameObject player = collision.gameObject; playerStatus player_ps = player.GetComponent <playerStatus>(); ArrowKeyMovement player_am = player.GetComponent <ArrowKeyMovement>(); if (player_ps.teamIdx == ps.teamIdx && player_ps.currStatus == playerStatus.status.DEFENSE && ps.currStatus == playerStatus.status.NORMAL) { ps.currStatus = playerStatus.status.HOLDING; player_am.defenseToHeld(); } } if (collision.gameObject.CompareTag("airwall")) { if (ps.currStatus == playerStatus.status.DASH) { am.stopDash = true; } } }
// Start is called before the first frame update void Start() { playerStatus = playerStatus.player_status; }
private void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <playerStatus>(); }