public void DestroyNetworkGems_RPC(string idsCSV) { string[] ids = GetGemsId(idsCSV); GemSpawner spawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); spawner.DestroyNetworkGems(ids); }
void Start() { // Cache references spawner = GetComponent <GemSpawner>(); destroyer = GetComponent <GemDestroyer>(); myCollider = GetComponent <Collider2D>(); container = GameObject.Find("Gem Container").transform; audioSource = GetComponent <AudioSource>(); // Initialize lists and arrays gemTable = new int[COL_NUM, ROW_NUM]; gemColumns = new List <Gem> [COL_NUM]; for (int x = 0; x < COL_NUM; x++) { gemColumns[x] = new List <Gem>(); } // Fill board with gems spawner.SpawnGems(true); // Break possible matches gemsToDestroy = MatchLib.CheckMatches(gemTable); // And keep doing so until there are no matches left while (gemsToDestroy.Count > 0) { destroyer.DestroyGems(true); spawner.SpawnGems(true); gemsToDestroy = MatchLib.CheckMatches(gemTable); } // Make sure there are possible moves for the player and no unbroken matches if (!MatchLib.MovementIsPossible(gemTable)) { MatchLib.Shuffle(gemColumns, gemTable); } // Disable collider myCollider.enabled = false; }
public void InformGemsDestroyed_RPC(string idsCSV) { string[] ids = GetGemsId(idsCSV); GemSpawner spawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); spawner.NetworkAddGainPointsEffects(ids); }
void OnPhotonInstantiate(PhotonMessageInfo info) { if (m_Gem == null) { Start(); } GemSpawner spawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); int lane = ( int )photonView.instantiationData[0]; int gemType = ( int )photonView.instantiationData[1]; int seqIndex = ( int )photonView.instantiationData[2]; m_Gem.Lane = lane; m_Gem.GemType = gemType; m_Gem.SequenceIndex = seqIndex; Vector3 pos = transform.position; pos.x = spawner.GetGemX(lane); pos.y = m_HalfDimension.y; transform.position = pos; if (!NetworkManager.IsPlayerOne()) { spawner.AddNetworkGem(this); spawner.SetGemSpriteContainer(GetComponent <GemSpriteContainer>(), gemType); } }
void OnPhotonInstantiate(PhotonMessageInfo info) { if (!NetworkManager.IsPlayerOne()) { GemSpawner spawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); spawner.AddNetworkGameTimer(this); } }
public void UnlinkNetworkGems_RPC(string idsCSV, string lanesCSV, float linkTime) { string[] ids = GetGemsId(idsCSV); string[] lanes = GetGemsLane(lanesCSV); GemSpawner spawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); spawner.UnlinkNetworkGems(ids, lanes, linkTime); }
public void DestroyNetworkGems_RPC(string idsCSV, string lanesCSV, int multiplier) { string[] ids = GetGemsId(idsCSV); string[] lanes = GetGemsLane(lanesCSV); GemSpawner spawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); spawner.DestroyNetworkGems(ids, lanes, multiplier); }
// Use this for initialization void Start() { m_bLinking = false; m_bCheckForDestroy = false; m_nLinkType = GemSpawner.INVALID_GEM; m_GemSpawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); m_DustEmitter = GameObject.Find("Fairy Dust").GetComponent <ParticleSystem>(); m_TrailRenderer = GetComponent <TrailRenderer>(); }
private void Awake() { if (Instance != null && Instance != this) { Destroy(this.gameObject); } Instance = this; }
void Start() { _spawner = FindObjectOfType <GemSpawner>(); SetupGrid(); while (CheckDeadlockGrid()) { ShuffleGrid(); while (CheckMatchGrid()) { UpdateGrid(); } } PlayerInput.Instance.swipe += CheckMove; FindObjectOfType <RoundManager>().roundStart += RoundStart; }
public void LinkNetworkGem(bool linked) { if (m_bOtherLinked != linked) { GemSpawner spawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); // If link, scale up change sprite if (linked) { spawner.SetLinkGemEffect(m_Gem); } // If not linked, scale back change sprite else { spawner.UnsetLinkGemEffect(m_Gem); } } m_bOtherLinked = linked; }
private void Awake() { _gemSpawner = GetComponent <GemSpawner>(); }
private void Awake() { Instance = this; }
public void UpdateHealth_RPC(int healthGain) { GemSpawner spawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); spawner.UpdateNetworkHealth(healthGain); }
// OnPhotonDisconnect (Go to score) public override void OnPhotonPlayerDisconnected(PhotonPlayer otherPlayer) { GemSpawner spawner = GameObject.Find("GemSpawner").GetComponent <GemSpawner>(); spawner.OnNetworkDisconnect(); }
// Use this for initialization void Start() { mGemSpawner = GameSingletons.GetComponent<GemSpawner>(); }