Beispiel #1
0
    private void addMaskCollision()
    {
        if (isCollisionOnList())
        {
            return;
        }

        Representor tempRep = representor.Instance() as Representor;

        collisionContainer.AddChild(tempRep);
        tempRep.setNumber(collisionValue.ToString());
        colValues.Add(collisionValue);

        Button remove = tempRep.GetChild(0) as Button;

        object[] obj = new object[1];
        obj[0] = collisionValue;
        remove.Connect("pressed", this, nameof(removeCollisionLayer), obj);
        collisions++;

        owner.SetCollisionMaskBit((int)collisionValue, true);
    }
Beispiel #2
0
    private void addMaskLayer()
    {
        if (isLayerOnList())
        {
            return;
        }

        Representor tempRep = representor.Instance() as Representor;

        layerContainer.AddChild(tempRep);
        tempRep.setNumber(layerValue.ToString());
        layerValues.Add(layerValue);

        Button remove = tempRep.GetChild(0) as Button;

        object[] obj = new object[1];
        obj[0] = layerValue;
        remove.Connect("pressed", this, nameof(removeMaskLayer), obj);
        masks++;


        owner.SetCollisionLayerBit((int)layerValue, true);
    }