private void CreateBoomerang() { //Удаляем прежний бумеранг при необходимости if (boomerang) { Destroy(boomerang.gameObject); boomerang = null; } if (string.IsNullOrEmpty(inventoryData.activeBoomerang)) { inventoryData.activeBoomerang = DefaultInventoryData.IdStandardBoomerang; } var data = inventoryData.items.Find(x => x.id == inventoryData.activeBoomerang); //Создание бумеранга var prefab = Resources.Load <GameObject>(string.Format(@"Prefabs/Skins/{0}/Boomerang", data.id)); var obj = Instantiate(prefab, gameboard); boomerang = obj.GetComponent <BoomerangController>(); boomerang.Initialize(data); //Events EventUpdateBoomerang?.Invoke(); EventShowMainMenu?.Invoke(); }
void Start() { aud = GetComponent <AudioSource> (); if (PlayerState.easterEgg) { aud.clip = superSecretSong; } for (int i = 1; i <= GlobalControl.NumPlayers; ++i) { isAlive [i] = true; GameObject player = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity); player.GetComponent <PlayerController> ().playerNum = i; players [i] = player; // in case of 10000 players } GameObject boomerangObject = Instantiate(boomerangPrefab, new Vector3(100f, 100f, 0f), Quaternion.identity); boomerang = boomerangObject.GetComponent <BoomerangController> (); boomerang.man = this; CheckNumPlayers(); StartNewRound(); }
void Start() { tpc = GameManager.instance.tpc; altOS = GameManager.instance.altOS; hookshot = GetComponent <HookshotController>(); hookshot.altweapons = this; boomerang = GetComponent <BoomerangController>(); boomerang.altweapons = this; bow = GetComponent <BowController>(); bow.altweapons = this; }
public void GetBoomerang(BoomerangController bController) { holding = true; if (!isDead) { spriteRenderer.color = Color.yellow; } bController.GetHolder(this.gameObject); boomerang = bController.gameObject; boomerang.SetActive(false); }