Esempio n. 1
0
    public void DrawFences()
    {
        if (fence == null)
        {
            if (!GameManager.instance.fenceDictionary.TryGetValue(username, out fence))
            {
                fence = new Fence(username);
            }
        }
        if (fence.polygon.Count <= 1)
        {
            return;
        }

        for (int i = 0; i < fence.polygon.Count - 1; i++)
        {
            FenceObject fObj = new FenceObject(fence.polygon[i], fence.polygon[i + 1], this);
            fenceObjects.Add(fObj.gameObj);
            //fObj.gameObj.transform.parent = this.transform;
        }

        FenceObject fObj2 = new FenceObject(fence.polygon[0], fence.polygon[fence.polygon.Count - 1], this);

        fenceObjects.Add(fObj2.gameObj);
        //fObj2.gameObj.transform.parent = this.transform;
    }
Esempio n. 2
0
    public void DrawFence(Fence fence, PlayerSetup pSetup)
    {
        //fence = fi;
        ClearFenceFromWorld(pSetup);

        if (fence.polygon.Count <= 1)
        {
            return;
        }

        for (int i = 0; i < fence.polygon.Count - 1; i++)
        {
            FenceObject fObj = new FenceObject(fence.polygon[i], fence.polygon[i + 1], this);
            pSetup.fenceObjects.Add(fObj.gameObj);
            //fObj.gameObj.transform.parent = this.gameObject.transform;
        }

        FenceObject fObj2 = new FenceObject(fence.polygon[0], fence.polygon[fence.polygon.Count - 1], this);

        pSetup.fenceObjects.Add(fObj2.gameObj);
        //fObj2.gameObj.transform.parent = this.gameObject.transform;
        Debug.Log(fence.polygon.Count + " ----Fences Created-----");
    }
Esempio n. 3
0
    public void DrawFenceGM(Fence fence, GameManager gm)
    {
        //fence = fi;
        ClearFenceFromWorldGM(gm);

        if (fence.polygon.Count <= 1)
        {
            return;
        }

        for (int i = 0; i < fence.polygon.Count - 1; i++)
        {
            FenceObject fObj = new FenceObject(fence.polygon[i], fence.polygon[i + 1], this);
            gm.fenceObjectsForNonConnected.Add(fObj.gameObj);
            //fObj.gameObj.transform.parent = this.gameObject.transform;
        }

        FenceObject fObj2 = new FenceObject(fence.polygon[0], fence.polygon[fence.polygon.Count - 1], this);

        gm.fenceObjectsForNonConnected.Add(fObj2.gameObj);
        //fObj2.gameObj.transform.parent = this.gameObject.transform;
        Debug.Log(fence.polygon.Count + " ----Fences Created-----");
    }
Esempio n. 4
0
 public override bool DoesGoThruFence( FenceObject fenceObject )
 {
     return true;
 }
Esempio n. 5
0
 /// <summary>
 /// Called whenever a tank collides with a fence.
 /// </summary>
 /// <param name="fenceObject">The fence the tank collided with.</param>
 /// <returns>True if the tank should go through the given fence - otherwise, false.</returns>
 public virtual bool DoesGoThruFence( FenceObject fenceObject )
 {
     return false;
 }