Beispiel #1
0
    //create the fragment icon that floats above the tile
    public void CreateFragRemains(Fragment f)
    {
        FragmentRemains fragr = ((FragmentRemains)((GameObject)Instantiate(Resources.Load("Prefabs/FragmentRemains"))).GetComponent("FragmentRemains"));

        fragr.SetTile(this);
        fragr.SetFragment(f);

        audio.PlayOneShot(PickupNoise);
    }
Beispiel #2
0
    public bool validaterReveal(Tile t, Tile f, int dir, int dDelta, int hDelta)
    {
        if (t.marked)
        {
            return(true);
        }
        //if(t.PeekFragment()==FragType.WOOD ||t.PeekFragment()==FragType.STONE||t.PeekFragment()==FragType.SOUL_GEM){
        //	return true;
        //}


        if (t.Resident && t.Resident.GetComponent("Building"))
        {
            return(true);
        }
        if (t.Resident && t.Resident.GetComponent("SoulWellTurnChange"))
        {
            return(true);
        }
        if (t.Resident)
        {
            return(true);
        }
        if (t.SurfaceFrag)
        {
            if (!(t.SurfaceFrag.GetType() == typeof(TreeFragment) && ((TreeFragment)t.SurfaceFrag).Growth == 0))
            {
                return(true);
            }
        }
        Fragment frag = FragmentManager.CreateFragment(t.PeekFragment());

        FragmentRemains fr = (FragmentRemains)((GameObject)Instantiate(Resources.Load("Prefabs/FragmentRemains"))).GetComponent("FragmentRemains");

        fr.transform.position = t.transform.position;
        fr.SetFragment(frag);
        fr.SetTile(t);
        fr.SetDeltaVector(new Vector3(0, 3, 0));
        fr.transform.localScale *= .75f;
        fr.SetTimer(300);

        Destroy(frag);

        t.marked = true;
        return(true);
    }