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();
    }
Exemplo n.º 2
0
    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);
        }
    }
Exemplo n.º 3
0
 public void DieImmediately()
 {
     Debug.Log("Chess:" + gameObject + "Die");
     gameObject.SetActive(false);
     if (deathParticle != null)
     {
         GridFunctionUtility.CreateParticleAt(deathParticle, this);
     }
     Destroy(gameObject);
 }
Exemplo n.º 4
0
 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;
     }
 }
Exemplo n.º 5
0
 public void FreezeFoot()
 {
     if (freezeFoot)
     {
         return;
     }
     if (prefabFreezenFootVFX != null)
     {
         freezenFootVFX = GridFunctionUtility.CreateParticleAt(prefabFreezenFootVFX, this);
     }
     freezeFoot = true;
 }
Exemplo n.º 6
0
 public virtual void Exit()
 {
     if (prefabExitParticle != null)
     {
         GridFunctionUtility.CreateParticleAt(prefabExitParticle, owner);
     }
     if (persistentParticle != null)
     {
         persistentParticle.GetComponent <ParticleSystem>().Stop();
         Destroy(persistentParticle, 10);
         persistentParticle = null;
     }
 }
Exemplo n.º 7
0
 public void Warm()
 {
     if (warm)
     {
         return;
     }
     if (prefabWarmVFX != null)
     {
         warmVFX = GridFunctionUtility.CreateParticleAt(prefabWarmVFX, this);
         warmVFX.transform.parent = render.transform;
     }
     warm = true;
 }
Exemplo n.º 8
0
 public void DeactiveFreezeFoot()
 {
     if (!freezeFoot)
     {
         return;
     }
     eFreezeFootBroken.Invoke();
     freezeFoot = false;
     Destroy(freezenFootVFX);
     if (prefabFreezenFootBrokenVFX != null)
     {
         GridFunctionUtility.CreateParticleAt(prefabFreezenFootBrokenVFX, this);
     }
     freezenFootVFX = null;
 }