Exemplo n.º 1
0
    public static WoodBlockerTemp GetBlockerForPoint(Vector3 point)
    {
        WoodBlockerTemp woodBlockerTemp;

        WoodBlockerTemp.TryInitBlockers();
        List <WoodBlockerTemp> .Enumerator enumerator = WoodBlockerTemp._blockers.GetEnumerator();
        try
        {
            while (enumerator.MoveNext())
            {
                WoodBlockerTemp current = enumerator.Current;
                if (Vector3.Distance(current.transform.position, point) >= 4f)
                {
                    continue;
                }
                woodBlockerTemp = current;
                return(woodBlockerTemp);
            }
            WoodBlockerTemp woodBlockerTemp1 = (WoodBlockerTemp)GameObject.CreatePrimitive(PrimitiveType.Sphere).AddComponent("WoodBlockerTemp");
            woodBlockerTemp1.renderer.enabled   = false;
            woodBlockerTemp1.collider.enabled   = false;
            woodBlockerTemp1.transform.position = point;
            woodBlockerTemp1.name = "WBT";
            return(woodBlockerTemp1);
        }
        finally
        {
            ((IDisposable)(object)enumerator).Dispose();
        }
        return(woodBlockerTemp);
    }
Exemplo n.º 2
0
 private void Awake()
 {
     WoodBlockerTemp.TryInitBlockers();
     this.numWood = (float)UnityEngine.Random.Range(10, 15);
     WoodBlockerTemp._blockers.Add(this);
     UnityEngine.Object.Destroy(base.gameObject, 300f);
 }