Ejemplo n.º 1
0
 public Mission GetMissionFromCellKey(IntVect2 key)
 {
     foreach (Mission mission in _Missions)
     {
         if (ShanghaiUtils.KeysMatch(mission.CellKey, key))
         {
             return(mission);
         }
     }
     Debug.Log("ERROR, couldn't get mission from key " + key);
     return(null);
 }
Ejemplo n.º 2
0
        public bool GenerateTarget()
        {
            IntVect2 cellKey = new IntVect2(0, 0);

            if (!_Model.Grid.GetRandomCell(ref cellKey))
            {
                return(false);
            }

            ShanghaiUtils.PaintColour targetColour = ShanghaiUtils.GetRandomColour(_Model.AvailableColours);
            Debug.Log("targetColour: " + targetColour);
            float  TTL    = _Config.TargetWaitTime;
            Target target = new Target(cellKey, targetColour, TTL);

            Messenger <Target> .Broadcast(EVENT_TARGET_CREATED, target);

            return(true);
        }
Ejemplo n.º 3
0
 //TODO: (CM) Should this be here? It's more like behaviour
 public void ChangeColour()
 {
     _PaintColour = ShanghaiUtils.GetRandomColour(_AvailableColours);
     Messenger <ShanghaiUtils.PaintColour> .Broadcast(EVENT_COLOUR_CHANGED, _PaintColour);
 }