コード例 #1
0
    public void ReplaceFrame(ECS.Data.Frame newValue)
    {
        var index     = InputComponentsLookup.Frame;
        var component = (FrameComponent)CreateComponent(index, typeof(FrameComponent));

        component.value = newValue;
        ReplaceComponent(index, component);
    }
コード例 #2
0
    public InputEntity SetFrame(ECS.Data.Frame newValue)
    {
        if (hasFrame)
        {
            throw new Entitas.EntitasException("Could not set Frame!\n" + this + " already has an entity with FrameComponent!",
                                               "You should check if the context already has a frameEntity before setting it or use context.ReplaceFrame().");
        }
        var entity = CreateEntity();

        entity.AddFrame(newValue);
        return(entity);
    }
コード例 #3
0
    public void ReplaceFrame(ECS.Data.Frame newValue)
    {
        var entity = frameEntity;

        if (entity == null)
        {
            entity = SetFrame(newValue);
        }
        else
        {
            entity.ReplaceFrame(newValue);
        }
    }