コード例 #1
0
        private void findAndUpdateNeightbor(Vector3 v)
        {
            BuildingWall wall = BuildingWall.getWall(this.getOrgin(), v);

            if (wall != null)
            {
                wall.updateSelfWalls();
            }
        }
コード例 #2
0
 public void updateState()
 {
     if (BuildingWall.getWall(this.parentWall.getOrgin(), this.vector) != null)
     {
         this.add();
     }
     else
     {
         this.remove();
     }
 }
コード例 #3
0
        private static BuildingWall getWall(Vector3 orgin, Vector3 direction)
        {
            RaycastHit hit;

            //Debug.DrawRay(orgin + (direction * 0.55f), direction * 0.55f, UnityEngine.Random.ColorHSV(), 100);
            if (Physics.Raycast(new Ray(orgin + (direction * 0.55f), direction), out hit, 0.45f, Layers.WALL))
            {
                // There is a wall new to this one, add an extension to this one.
                BuildingWall wall = hit.transform.GetComponent <BuildingWall>();
                if (wall == null)
                {
                    throw new Exception("GameObject with layer \"Wall\" found without a BuildingWall component!");
                }
                return(wall);
            }
            else
            {
                return(null);
            }
        }
コード例 #4
0
 public WallExtension(BuildingWall parentWall, string saveName, Vector3 vec)
 {
     this.parentWall = parentWall;
     this.saveName   = saveName;
     this.vector     = vec;
 }