IEnumerator PreEnvironmentTurn() { Vector2Int yRange = GridFunctionUtility.GetPlayerChessyRange(); yRange.x = Mathf.Max(0, yRange.x - stormAroundDistance); yRange.y = Mathf.Min(GridManager.instance.size.y - 1, yRange.y + stormAroundDistance); for (int i = 0; i < stormNum; i++) { Vector2Int location; do { location = GridFunctionUtility.GetRandomLocation(yRange); }while (stormLocation.Contains(location)); stormLocation.Add(location); } foreach (var location in stormLocation) { GameObject t = GridFunctionUtility.CreateParticleAt(prefabStorm, location); Material mat = t.GetComponent <MeshRenderer>().material; Color color = mat.GetColor("_Color"); mat.SetColor("_Color", Color.yellow); stormParticle.Add(t); yield return(new WaitForSeconds(1f)); mat.SetColor("_Color", color); } GameManager.instance.EnvironmentPreTurnEnd(); }
public virtual void ElementReaction(Element element) { if (elementComponent) { switch (element) { case Element.Fire: if (iceParticle != null) { GridFunctionUtility.CreateParticleAt(fireParticle, this); } break; case Element.Ice: if (iceParticle != null) { GridFunctionUtility.CreateParticleAt(iceParticle, this); } break; default: break; } elementComponent.OnHitElement(element); eElementReaction.Invoke(element); } }
public void DieImmediately() { Debug.Log("Chess:" + gameObject + "Die"); gameObject.SetActive(false); if (deathParticle != null) { GridFunctionUtility.CreateParticleAt(deathParticle, this); } Destroy(gameObject); }
public virtual void Enter() { if (prefabEnterParticle != null && !disableParticle) { GridFunctionUtility.CreateParticleAt(prefabEnterParticle, owner); } if (prefabPersistentParticle != null) { persistentParticle = GridFunctionUtility.CreateParticleAt(prefabPersistentParticle, owner); persistentParticle.transform.parent = owner.render.transform; } }
public void FreezeFoot() { if (freezeFoot) { return; } if (prefabFreezenFootVFX != null) { freezenFootVFX = GridFunctionUtility.CreateParticleAt(prefabFreezenFootVFX, this); } freezeFoot = true; }
public virtual void Exit() { if (prefabExitParticle != null) { GridFunctionUtility.CreateParticleAt(prefabExitParticle, owner); } if (persistentParticle != null) { persistentParticle.GetComponent <ParticleSystem>().Stop(); Destroy(persistentParticle, 10); persistentParticle = null; } }
public void Warm() { if (warm) { return; } if (prefabWarmVFX != null) { warmVFX = GridFunctionUtility.CreateParticleAt(prefabWarmVFX, this); warmVFX.transform.parent = render.transform; } warm = true; }
public void DeactiveFreezeFoot() { if (!freezeFoot) { return; } eFreezeFootBroken.Invoke(); freezeFoot = false; Destroy(freezenFootVFX); if (prefabFreezenFootBrokenVFX != null) { GridFunctionUtility.CreateParticleAt(prefabFreezenFootBrokenVFX, this); } freezenFootVFX = null; }