Beispiel #1
0
 public SnapTarget (PosInCell p1, Vector3Int v, List<string> totags, PosInCell p2)
 {
     /*
      * SnapTargets allow objects to snap to other based on their template
      * FromPos = the PosInCell of the object is its cell, based on its template and sometimes rotation
      * ToCentre = the object can snap to a target object with its cell centre located at its own cell centre + ToCentre
      * ToTags = the target's template must contain one of those tags
      * ToPos = the target object must be at that PosInCell in its cell
      */
     FromPos = p1;
     ToCentre = v;
     ToTags = new List<string>();
     foreach (string s in totags)
     {
         ToTags.Add(s);
     }
     ToPos = p2;
 }
Beispiel #2
0
 public SnapTarget(PosInCell fromPos, int x, int y, int z, List<string> totags, PosInCell toPos) : this(fromPos, Vector3Int.zero , totags, toPos)
 {
     ToCentre = new Vector3Int(x, y, z);
 }
Beispiel #3
0
        public void AddSnapTarget(PosInCell fromPos, int x, int y, int z, List <string> totags, PosInCell toPos)
        {
            SnapTarget st = new SnapTarget(fromPos, x, y, z, totags, toPos);

            SnapTargets.Add(st);
        }