コード例 #1
0
    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();
    }
コード例 #2
0
 public bool MatchesType(SnapTargetType type)
 {
     return (this.snapTargetType == type);
 }
コード例 #3
0
    /////////////////////////// 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;
    }