public void Display(PlayerScripts player, Essen essen, bool hasWon) { GetComponent <Canvas>().enabled = true; string displayText = ""; FoodItems = new List <GameObject>(); if (hasWon) { displayText += "Congratulations, you cooked the correct meal.\n"; } else { displayText += "Oh no, you cooked the wrong meal.\n"; } int zutatNum = 0; essen.ZutatenListe.ForEach(z => { displayText += z.ZutatName + " " + convertZustand(z.Zustand) + "\n"; Image img = Instantiate(FoodDisplay, transform).GetComponent <Image>(); img.transform.localPosition = new Vector3(300, 100 - 40 * zutatNum, 0); img.sprite = z.ZutatName == ZutatTyp.Tomato ? FoodSprites[0] : z.ZutatName == ZutatTyp.Mushrooms ? FoodSprites[1] : FoodSprites[2]; FoodItems.Add(img.gameObject); zutatNum++; } ); displayText += player.quest.description; textObj.text = displayText; }
public void createpatterns(MusicInfoScript musicinfo) { foreach (TypeProperty typeprop in musicinfo.propertiesList) { TypeMethods luatype = new TypeMethods(typeprop); PlayerScripts temp = null; foreach (PlayerScripts playerscript in staticstuff.SelectedScripts) { LuaFunction checkprop = playerscript.script.GetFunction("checkProp"); object[] returnvalues = checkprop.Call(luatype); if ((bool)returnvalues[0]) { patternindex.Add(typeprop.segmentnumber, new LuaScriptFacade(playerscript.script, bulletrepo, origin, defaultbullet, luatype)); temp = playerscript; break; } } if (temp != null) { staticstuff.SelectedScripts.Remove(temp); } else { patternindex.Add(typeprop.segmentnumber, new LuaScriptFacade(staticstuff.defaultScript.script, bulletrepo, origin, defaultbullet, luatype)); } } //if(musicinfo.patterntypes.Count!=0) //add remaining to default }
// Update is called once per frame void Update() { GameObject Points = GameObject.Find("Player"); PlayerScripts Player = Points.GetComponent <PlayerScripts>(); int MyPoints = Player.PlayerPoints; MyScore.text = MyPoints.ToString(); }
// Update is called once per frame void Update() { GameObject Health = GameObject.Find("Player"); PlayerScripts Player = Health.GetComponent <PlayerScripts>(); int MyLives = Player.Health; MyLive.text = "Live:" + MyLives.ToString(); }
void Add_100G() { PlayerScripts player = _player.GetComponent <PlayerScripts>(); if (player != null) { player.diamonds += 100; } }
public void generatePlayerCharacter(UInt64 playerId) { var playerStateManager = this.createPlayerStateManager("Player", AccountData.Instance.FamilyName, AccountData.Instance.CurrentCharacter); var playerController = playerStateManager.gameObject.AddComponent <PlayerController>(); PlayerScripts playerScripts = new PlayerScripts(playerController, playerStateManager); playerList.AddLast(new KeyValuePair <UInt64, PlayerScripts>(playerId, playerScripts)); }
private void OnTriggerEnter(Collider HitScan) { PlayerScripts player = HitScan.GetComponent <PlayerScripts>(); if (player != null) { player.TakeDamage(3); Destroy(gameObject); } }
public void Init(float x, float y, float z, Color color, State state, int HP, int Point, PlayerScripts player) { //var sodomit = Instantiate(EnemyShip, new Vector3(x, y, z), Quaternion.identity); Player = player; myTransform.position = new Vector3(x, y, z); mRenderer.material.SetColor("_Color", color); enemyState = state; Health = HP; points = Point; }
private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { PlayerScripts player = other.GetComponent <PlayerScripts>(); if (player != null) { player.diamonds += germs; Destroy(this.gameObject); } } }
private void OnCollisionEnter2D(Collision2D other) { if (other.collider.tag == "Player") { PlayerScripts player = other.transform.GetComponent <PlayerScripts>(); player.PlayerHealthUI.SetActive(false); player.anim.SetTrigger("dealth"); //player.enabled = false; Destroy(player.gameObject, 2.0f); Invoke("BackToDashBoard", 2.0f); } }
void Start() { //reference to the red belt drop off point redBeltLoc = GameObject.Find("redBeltDropOffLocation"); //reference to the player player = GameObject.FindGameObjectWithTag("Player"); //reference to the player script playerScripts = player.GetComponent <PlayerScripts>(); //Get the location of the box placeholder boxPlaceHolder = GameObject.Find("BoxHolder"); //startingPosition = transform.localPosition; SetGazedAt(false); }
private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { _player = other.GetComponent <PlayerScripts>(); if (_player != null) { UIManager._instance.OpenShop(_player.diamonds); SelectedItem(0); } shopPanel.SetActive(true); } }
// initialization void Awake() { if (instance == null) { instance = this; } float cameraHeight = Camera.main.orthographicSize; // position the arrow exactly below the camera height = -cameraHeight - 0.8f; canWalk = true; shootOnce = true; shootTwice = true; }
private void notifyConnectPlayer(Packet rowPacket) { var packet = rowPacket as NotifyConnectPlayerPacket; var stateManager = this.createPlayerStateManager("Other Player", packet.playerInfo.familyName, packet.playerInfo.characterInfo); var controller = stateManager.gameObject.AddComponent <BaseController>(); var scripts = new PlayerScripts(controller, stateManager); if (stateManager.info.currentHp <= 0) { stateManager.die(); } playerList.AddLast(new KeyValuePair <UInt64, PlayerScripts>(packet.playerInfo.id, scripts)); }
private void OnTriggerEnter(Collider HitScan) { PlayerScripts Player = HitScan.GetComponent <PlayerScripts>(); if (Player != null) { Player.TakeDamage(1); Destroy(gameObject); } EnemyScript ground = HitScan.GetComponent <EnemyScript>(); if (ground != null) { Destroy(gameObject); } }
private void WriteMapDataTo(BinaryWriter writer, AssetNameCollection assetNames) { if (ScriptImportSize != null) { writer.Write(assetNames.GetOrCreateAssetIndex(ScriptImportSize.AssetName)); ScriptImportSize.WriteTo(writer, assetNames); } writer.Write(assetNames.GetOrCreateAssetIndex(PlayerScriptsList.AssetName)); PlayerScripts.WriteTo(writer, assetNames); if (NamedCameras != null) { writer.Write(assetNames.GetOrCreateAssetIndex(NamedCameras.AssetName)); NamedCameras.WriteTo(writer); } if (CameraAnimationList != null) { writer.Write(assetNames.GetOrCreateAssetIndex(CameraAnimationList.AssetName)); CameraAnimationList.WriteTo(writer); } writer.Write(assetNames.GetOrCreateAssetIndex(ScriptsPlayers.AssetName)); ScriptsPlayers.WriteTo(writer, assetNames); writer.Write(assetNames.GetOrCreateAssetIndex(ObjectsList.AssetName)); ObjectsList.WriteTo(writer, assetNames); if (PolygonTriggers != null) { writer.Write(assetNames.GetOrCreateAssetIndex(PolygonTriggers.AssetName)); PolygonTriggers.WriteTo(writer); } if (TriggerAreas != null) { writer.Write(assetNames.GetOrCreateAssetIndex(TriggerAreas.AssetName)); TriggerAreas.WriteTo(writer); } writer.Write(assetNames.GetOrCreateAssetIndex(ScriptTeams.AssetName)); Teams.WriteTo(writer, assetNames); writer.Write(assetNames.GetOrCreateAssetIndex(WaypointsList.AssetName)); WaypointsList.WriteTo(writer); }
protected void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player") { PlayerScripts player = collision.GetComponent <PlayerScripts>(); if (player != null) { if (isCheck == true) { isCheck = false; player.PlayerDamage(); } StartCoroutine(restisCheck()); } } }
private void notifyDisconnectPlayer(Packet rowPacket) { var packet = rowPacket as NotifyDisconnectPlayerPacket; var node = playerList.First; while (node != null) { var nextNode = node.Next; if (node.Value.Key == packet.playerId) { PlayerScripts scripts = node.Value.Value; Destroy(scripts.controller.gameObject); playerList.Remove(node); return; } node = nextNode; } }
private void WriteMapDataTo(BinaryWriter writer, AssetNameCollection assetNames) { writer.Write(assetNames.GetOrCreateAssetIndex(PlayerScriptsList.AssetName)); PlayerScripts.WriteTo(writer, assetNames); writer.Write(assetNames.GetOrCreateAssetIndex(ScriptsPlayers.AssetName)); Players.WriteTo(writer); writer.Write(assetNames.GetOrCreateAssetIndex(ObjectsList.AssetName)); ObjectsList.WriteTo(writer, assetNames); writer.Write(assetNames.GetOrCreateAssetIndex(PolygonTriggers.AssetName)); PolygonTriggers.WriteTo(writer); writer.Write(assetNames.GetOrCreateAssetIndex(ScriptTeams.AssetName)); Teams.WriteTo(writer, assetNames); writer.Write(assetNames.GetOrCreateAssetIndex(WaypointsList.AssetName)); WaypointsList.WriteTo(writer); }
private void Awake() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerScripts>(); }
// Use this for initialization void Start() { player = FindObjectOfType<PlayerScripts>(); }
void Awake() { playerScript = player.GetComponent <PlayerScripts>(); }
private void SpawnSodomit(float x, float y, float z, Color color, EnemyScript.State state, int HP, int Point, PlayerScripts player) { var sodomit = Instantiate(EnemyShip, Vector3.zero, Quaternion.identity) .GetComponent <EnemyScript>(); sodomit.Init(x, y, z, color, state, HP, Point, player); }
public void GetPlayerScripts(GameObject ball) { //ボールはPlayerScriptsを取得する、PlayerScriptsを新しく定義 playerScripts = ball.GetComponent <PlayerScripts> (); }