Beispiel #1
0
        public ItemBase(string image, string caption, bool givable = true, bool combinable = true)
        {
            Sprite
            .Create(this)
            .SetRenderStage(RenderStage.PostBloom)
            .SetImage(image);

            Transform
            .Create(this);

            Interaction
            .Create(this)
            .SetGetInteractionsFn(GetInteractions);

            HotspotSprite
            .Create(this)
            .SetCaption(caption);

            if (givable)
            {
                Givable
                .Create(this);
            }

            if (combinable)
            {
                Combinable
                .Create(this);
            }
        }
Beispiel #2
0
        public DrillingMachine()
        {
            Interaction
            .Create(this)
            .SetPosition(408, 261)
            .SetDirection(Directions8.Up)
            .SetGetInteractionsFn(GetInteractions);

            HotspotRectangle
            .Create(this)
            .SetCaption(Basement_Res.drilling_machine)
            .AddRectangle(411, 154, 21, 22);

            Transform
            .Create(this)
            .SetPosition(426, 152)
            .SetZ(Workbench.Z + 1);

            Sprite
            .Create(this)
            .SetImage(content.rooms.basement.drillholesaw)
            .SetVisible(false);

            Combinable
            .Create(this);

            Enabled = false;
        }
Beispiel #3
0
        public DrillingMachineCable()
        {
            Interaction
            .Create(this)
            .SetPosition(408, 261)
            .SetDirection(Directions8.Up)
            .SetGetInteractionsFn(GetInteractions);

            HotspotRectangle
            .Create(this)
            .SetCaption(Basement_Res.cable)
            .AddRectangle(387, 224, 28, 13);

            Transform
            .Create(this)
            .SetPosition(234, 203)
            .SetZ(-1.5f);

            Sprite
            .Create(this)
            .SetImage(content.rooms.basement.cable)
            .SetVisible(false);

            Combinable
            .Create(this);

            Enabled = false;
        }
    private void OnTriggerEnter(Collider other)
    {
        Combinable otherComb = other.gameObject.GetComponent <Combinable>();

        if (otherComb != null)
        {
            int i = otherComb.Compare(id);
            if (i != -1)
            {
                TrickManager._instance.AddTrick(otherComb.trickName[i], otherComb.score[i]);
            }
        }
    }
Beispiel #5
0
    private void OnTriggerEnter(Collider other)
    {
        Combinable otherComb = other.gameObject.GetComponent <Combinable>();

        if (otherComb != null)
        {
            int i = otherComb.Compare(id);
            if (i != -1 && fullOf == "SANDWICH")
            {
                fullOf = otherComb.trickName[i];
                TrickManager._instance.AddTrick(otherComb.trickName[i], otherComb.score[i]);
                return;
            }

            i = otherComb.Compare(idDrink);
            if (i != -1)
            {
                TrickManager._instance.AddTrick(fullOf + " " + otherComb.trickName[i], otherComb.score[i]);
                fullOf = "SANDWICH";

                if (pickup != null)
                {
                    pickup.ForceDrop();
                }

                transform.position = defaultPos;
                transform.rotation = defaultRot;

                return;
            }

            i = otherComb.Compare(idDrink2);
            if (i != -1)
            {
                TrickManager._instance.AddTrick(otherComb.trickName[i], otherComb.score[i]);
                fullOf = "SANDWICH";

                if (pickup != null)
                {
                    pickup.ForceDrop();
                }

                transform.position = defaultPos;
                transform.rotation = defaultRot;
            }
        }
    }
Beispiel #6
0
    private void OnTriggerEnter(Collider other)
    {
        Combinable otherComb = other.gameObject.GetComponent <Combinable>();

        if (otherComb != null)
        {
            int i = otherComb.Compare(id);
            if (i != -1 && fullOf == "TOOTH")
            {
                fullOf = otherComb.trickName[i];
                TrickManager._instance.AddTrick(otherComb.trickName[i], otherComb.score[i]);
                return;
            }

            i = otherComb.Compare(idDrink);
            if (i != -1)
            {
                TrickManager._instance.AddTrick(fullOf + " " + otherComb.trickName[i], otherComb.score[i]);
                fullOf = "TOOTH";
            }
        }
    }
    private void OnTriggerEnter(Collider other)
    {
        Combinable otherComb = other.gameObject.GetComponent <Combinable>();

        if (otherComb != null)
        {
            int i = otherComb.Compare(id);
            if (i != -1 && fullOf == "")
            {
                fullOf = otherComb.trickName[i];
                TrickManager._instance.AddTrick(otherComb.trickName[i], otherComb.score[i]);
                renderer.material.color = otherComb.color[i];
                return;
            }

            i = otherComb.Compare(idDrink);
            if (i != -1 && fullOf != "")
            {
                TrickManager._instance.AddTrick(otherComb.trickName[i] + " " + fullOf, otherComb.score[i]);
                renderer.material.color = emptyColor;
                fullOf = "";
            }
        }
    }