예제 #1
0
    void Update()
    {
        //pSpot = GetComponent<Player> ();
        //mPlayerSpot = pSpot.mCurrentSpot;
        //if (mID == mPlayerSpot)
        //{
        //	mSetSpace = (OccupyType)mPlayerSpot;
        //}
        mSpaceFilledWith = mSetSpace;

        //Switch bettween different exceptions
        switch (mSpaceFilledWith)
        {
        case OccupyType.Empty:
            gameObject.renderer.material.color = Color.blue;
            break;

        case OccupyType.Player:
            gameObject.renderer.material.color = Color.green;
            break;

        case OccupyType.Target:
            gameObject.renderer.material.color = Color.red;
            break;

        case OccupyType.Wall:
            gameObject.renderer.material.color = Color.black;
            break;
        }
    }
예제 #2
0
 public void SetOccupant(int Occupy)
 {
     if (mSpaceFilledWith == OccupyType.Empty)
     {
         mSpaceFilledWith = (OccupyType)Occupy;
     }
 }
예제 #3
0
    void Start()
    {
        mID = int.Parse(this.name);
        //pSpot = GetComponent<Player> ();
        //mPlayerSpot = pSpot.mCurrentSpot;
        //if (mID == mPlayerSpot)
        //{
        //	mSetSpace = (OccupyType)mPlayerSpot;
        //}
        mSpaceFilledWith = mSetSpace;

        //use if to instantiate specific space types
    }
예제 #4
0
        public bool IsOccupiedSeat(List <Seat> seats, List <SeatCoord> extraSeatCoords, int y, int x, bool debug_, out OccupyType type)
        {
            if (debug_)
            {
                //debug.Add(String.Format("   Checking: Y = {0}, X = {1}", y, x));
            }
            foreach (Seat s in seats)
            {
                if (s.RowX == x && s.RowY == y)
                {
                    type = OccupyType.Occupied;
                    return(true);
                }
            }
            if (extraSeatCoords != null)
            {
                foreach (SeatCoord sc in extraSeatCoords)
                {
                    if (sc.X == x && sc.Y == y)
                    {
                        type = OccupyType.Selected;
                        return(true);
                    }
                }
            }

            type = OccupyType.Unoccupied;
            return(false);
        }