public PositionData SetObjectAt(Transform thing, PositionData.OccupantType ot, int index) { PositionData pd = FindPositionData(index); if (pd != null) { Debug.LogFormat("Placing occupant {0} at index {1}", ot, index); thing.transform.position = transform.TransformPoint(pd.centrePos); pd.occupant = ot; return(pd); } return(null); }
public bool CreateObjectAt(GameObject template, PositionData.OccupantType ot, int index) { PositionData pd = FindPositionData(index); if (pd != null) { Debug.LogFormat("Creating occupant {0} at index {1}", ot, index); if (pd.occupant != PositionData.OccupantType.None) { Debug.LogWarningFormat("Trying to place {0} but position occupied by {1}!", ot, pd.occupant); return(false); } GameObject go = gameData.GetObject(template); go.transform.position = transform.TransformPoint(pd.centrePos); pd.occupant = ot; return(true); } return(false); }
public void PlaceOccupant(PositionData pd, PositionData.OccupantType ot) { Debug.LogFormat("Placing occupant {0} at index {1}", ot, pd.landingQuad.startTriangleIndex); pd.occupant = ot; }