コード例 #1
0
    public void RenameAtom(int atomicNumber, string name, string abbreviation)
    {
        Atom atom = Game.Instance.gameData.FindAtom(atomicNumber);

        if (atom != null && atom.CanBeRenamed())   // Already Exists, Renames
        {
            atom.Rename(name, abbreviation);

            if (OnAtomRename != null)
            {
                OnAtomRename(atom, 0);
            }

            var craftable = Craftable.CreateNewBlock(atom);
            Game.Instance.gameData.AddCraftable(craftable);
        }
    }
コード例 #2
0
    public void Load(SaveData s)
    {
        for (int i = 0; i < atomData.Count; i++)
        {
            atoms[i].Init(s.atomNames[i]);
            atomData[i].Init(s.atomData[i]);
        }
        maxAtom = s.maxAtom;

        for (int i = 118; i < atomData.Count; i++)
        {
            if (atomData[i].IsDiscovered())
            {
                var craftable = Craftable.CreateNewBlock(atomData[i].GetAtom());
                Game.Instance.gameData.AddCraftable(craftable);
            }
        }
    }