public void Deserialize(DeserializeEvent e)
    {
        CaptureState oldCaptureState = captureState;
        float        oldCaptureTimer = captureTimer;

        captureState    = (CaptureState)e.Reader.ReadInt32();
        capturingTeamId = e.Reader.ReadUInt16();
        owningTeamId    = e.Reader.ReadUInt16();
        captureTimer    = e.Reader.ReadSingle();

        if (captureTimer != oldCaptureTimer)
        {
            percentageRadius.SetDisplayAmounts(captureTimer, captureTime);
        }

        if (captureState != oldCaptureState)
        {
            if (captureState == CaptureState.CAPTURED)
            {
                outlineColorable.SetColor(clientGameManager.GameState.teams[owningTeamId].color);
                fillColorable.SetColor(clientGameManager.GameState.teams[owningTeamId].color);
            }
            else if (captureState == CaptureState.CAPTURING)
            {
                fillColorable.SetColor(clientGameManager.GameState.teams[capturingTeamId].color);
            }
        }
    }
Beispiel #2
0
    public void Init(Color color, Transform parent)
    {
        Init(parent, Vector2.zero);

        Color = color;
        Colorable.SetColor(Color.clear);
        ColorSwapable.Swap(color);
    }
Beispiel #3
0
 public override void Test()
 {
     Hidable.SetColor(new Color(Random.value, Random.value, Random.value));
 }