Ejemplo n.º 1
0
    public void AtomPreCombine(PreCombineParam preCombineParam)
    {
        var atom = preCombineParam.fromAtom;

        if (atom.isCanCraft && GameDataManager.instance.gameData.tutorialData.iKnowIShouldNotMergeGreenTile-- > 0)
        {
            dontMergeGreenTileIngredientImage.sprite = atom.atomDisplay.spriteRendererBG.sprite;
            dontMergeGreenTilePanel.SetActive(true);
            preCombineParam.canNotCombine = true;
        }
    }
Ejemplo n.º 2
0
    public void CombineAtom(Atom fromAtom, Atom toAtom)
    {
        var preCombineParam = new PreCombineParam()
        {
            fromAtom = fromAtom,
            toAtom   = toAtom
        };

        OnPreAtomCombined.Invoke(preCombineParam);
        if (preCombineParam.canNotCombine)
        {
            return;
        }
        OnAtomDestroy.Invoke(fromAtom);
        RemoveAtom(fromAtom);
        Destroy(fromAtom.gameObject);
        toAtom.CombineAtom();
        OnAtomCombined.Invoke(toAtom);
    }