public SnapTarget(GameObject gameObject, SnapTargetType snapTargetType, bool room) { this.workStation = gameObject; this.snapTargetType = snapTargetType; this.room = room; SnapTargetScript script = workStation.GetComponent<SnapTargetScript>(); this.zone = script.isAZone(); this.animation = script.animation.ToString(); }
public bool MatchesType(SnapTargetType type) { return (this.snapTargetType == type); }
/////////////////////////// FIND OPEN SNAPTARGET ////////////////////////////// public static SnapTarget FindOpenSnapTargetOfType(SnapTargetType type) { foreach(SnapTarget snapTarget in snaptargets) if(snapTarget != null && !snapTarget.isRoom() && snapTarget.MatchesType(type) && snapTarget.isEmpty()) return snapTarget; return null; }