Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public void PlaceOccupant(PositionData pd, PositionData.OccupantType ot)
        {
            Debug.LogFormat("Placing occupant {0} at index {1}", ot, pd.landingQuad.startTriangleIndex);

            pd.occupant = ot;
        }