public void OnColourChanged(ShanghaiUtils.PaintColour colour) { Flash.ResetToBeginning(); Flash.PlayForward(); CurrentColor = colour; ColourSprite.color = ShanghaiUtils.GetColour(colour); }
private IEnumerator PaintCell(float waitTime, Cell cell, ShanghaiUtils.PaintColour colour, int points) { yield return(new WaitForSeconds(waitTime)); cell.Reset(); cell.Colour = colour; _Model.Point += points; Messenger <int, Cell> .Broadcast(ModelController.EVENT_POINTS_AWARDED, points, cell); RegenerateSurroundingCells(cell); Messenger <Cell> .Broadcast(Cell.EVENT_CELL_UPDATED, cell); }
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); }
public void KillCell() { Reset(); State = Cell.CellState.DEAD; Colour = ShanghaiUtils.PaintColour.NONE; }
public Source(IntVect2 cellKey, float ttl, ShanghaiUtils.PaintColour colour) { CellKey = cellKey; TTL = ttl; PaintColour = colour; }
//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); }
public Target(IntVect2 cellKey, ShanghaiUtils.PaintColour colour, float ttl) { CellKey = cellKey; PaintColour = colour; TTL = ttl; }