Ejemplo n.º 1
0
        private void Melt(HeatMessage message, Collider2D col)
        {
            if (timer > 0.25f)
            {
                timer = 0;
            }


            //if (Random.value < message.Intensity / 100)
            if (timer == 0)
            {
                IEnumerable <Vector2> points = GetPointsInRange(col);
                foreach (var point in points)
                {
                    D2dDestructible.StampAll(point, Vector2.one * StampSize, 0, StampTex, 1, 1 << LayerMask.NameToLayer(Layers.Ice));
                }


                //_polyCollider.points = MovePointsInwards(col);
                //_polyCollider.points = FlattenAngles();
                //SetMeshFilterToPolyColliderPoints();
            }
            timer += Time.deltaTime;
        }
Ejemplo n.º 2
0
 void Awake()
 {
     _heatLightPrefab = (GameObject)Resources.Load("fireplaces/TetherLight");
     _col             = GetComponent <BoxCollider2D>();
     HeatMessage      = new HeatMessage(20, 0);
 }