Exemplo n.º 1
0
 public override void EffectFinish(HexEffect hexEffect)
 {
     numAbsorbed++;
     Debug.Log(TAG + "effect finished. left to Absorb = " + numToAbsorb);
     if (numToAbsorb == numAbsorbed)
     {
         willExplode = true;
         timer       = 0.5f;
     }
 }
Exemplo n.º 2
0
 public override void EffectFinish(HexEffect hexEffect)
 {
     Debug.Log(TAG + "effect finished.");
     numAbsorbed++;
     if (numAbsorbed >= numToAbsorb)
     {
         willExplode = true;
         timer       = 0.25f;
         Debug.Log(TAG + "done absorbing");
     }
 }
Exemplo n.º 3
0
    public void CreateAbsorb()
    {
        if (val == 0)
        {
            Clear(1, activeTool);
            return;
        }
        else
        {
            SetWillMix(0.0f);
        }
        GameObject g = Instantiate(GetPrefab(ABSORB_PREFAB));

        g.transform.position = transform.position;
        HexEffect  hexEffect = g.GetComponent <HexEffect>();
        GameObject target    = activeTool.GetTarget();

        hexEffect.SetUp(activeTool, this);
    }
Exemplo n.º 4
0
    public void Clear(int i, Tool tool)
    {
        gameObject.SetActive(false);
        isActive = false;
        if (createEffect)
        {
            GameObject prefab = GetPrefab(i);
            GameObject g      = Instantiate(prefab);
            g.transform.position = transform.position;
            if (g == null)
            {
                Debug.Log(tag + "prefab is null");
                return;
            }

            HexEffect hexEffect = g.GetComponent <HexEffect>();
            if (tool == null)
            {
                //Debug.Log(TAG + "tool is null");
                hexEffect.SetUp(tool, this);
            }
            else
            {
                //Debug.Log(TAG + "tool is not null");
                GameObject target = tool.GetTarget();
                hexEffect.SetUp(tool, this);
            }
            //TODO check for null target

            //TODO change for particle effect
            //ParticleSystem p =g.GetComponentInChildren<ParticleSystem>();
            //var main = p.main;


            //main.startColor = color;
            val = 0;
        }
        gridManager.CheckIfComplete();
    }
Exemplo n.º 5
0
 public virtual void EffectFinish(HexEffect hexEffect)
 {
     Debug.Log(TAG + "effect finished.");
 }