コード例 #1
0
ファイル: GroupNode.cs プロジェクト: r2d2m/NodeGame
        public override void BeginSetup()
        {
            GameObject go = new GameObject("InputManager(group) - groupName");

            group             = go.AddComponent <InputManager>();
            group.groupMode   = true;
            group.hostIfGroup = this;
            serializer.PrepareForSerialization();
        }
コード例 #2
0
    public void Save()
    {
        Debug.Log("save");
        InputManagerSerializer dick = new InputManagerSerializer();

        for (int i = 0; i < allNodes.Count; i++)
        {
            dick.Add(allNodes[i].GetComponent <NodeVisual>().node, new Position2(allNodes[i].position));
        }
        dick.PrepareForSerialization();
        if (forceOverrideSave)
        {
            DoSave(null, dick);
        }
        else
        {
            if (File.Exists(Application.dataPath + "/Spells/" + saveName + ".SpellDic"))
            {
                //ask player if he wants to override
                //if not return;
                MsgBox.Make("A spell with this name: \"" + saveName + "\" already exists !\nDo you want to overwrite it ?\n(the old one will be lost)",
                            new string[] { "JUST DO IT!", "Don't do it bro" },
                            new MsgBox.OnButtonClick[] { DoSave, DontDoSave },
                            new object[] { dick });
            }
            else
            {
                DoSave(null, dick);
            }
        }
    }