コード例 #1
0
    public void ReplaceCurrentReplayData(SCMatchRecord newValue)
    {
        var index     = GameComponentsLookup.CurrentReplayData;
        var component = (CurrentReplayDataComponent)CreateComponent(index, typeof(CurrentReplayDataComponent));

        component.value = newValue;
        ReplaceComponent(index, component);
    }
コード例 #2
0
    public GameEntity SetCurrentReplayData(SCMatchRecord newValue)
    {
        if (hasCurrentReplayData)
        {
            throw new Entitas.EntitasException("Could not set CurrentReplayData!\n" + this + " already has an entity with CurrentReplayDataComponent!",
                                               "You should check if the context already has a currentReplayDataEntity before setting it or use context.ReplaceCurrentReplayData().");
        }
        var entity = CreateEntity();

        entity.AddCurrentReplayData(newValue);
        return(entity);
    }
コード例 #3
0
    public void ReplaceCurrentReplayData(SCMatchRecord newValue)
    {
        var entity = currentReplayDataEntity;

        if (entity == null)
        {
            entity = SetCurrentReplayData(newValue);
        }
        else
        {
            entity.ReplaceCurrentReplayData(newValue);
        }
    }