public void createCharacter(string name)
    {
        PlayerData newPlayer   = PlayerDataHelper.createNewPlayer(name);
        GameData   newGameData = (GameData)ScriptableObject.CreateInstance("GameData");

        newGameData.name       = "gameDataContainer";
        newGameData.playerData = newPlayer;
        GameObject.Find("Game Data Controller").GetComponent <GameDataController>().gameData = newGameData;
        SceneManager.LoadScene("Opening Cutscene", LoadSceneMode.Additive);
        SceneManager.UnloadSceneAsync("Character Creator");
    }
Ejemplo n.º 2
0
        public void Initialize()
        {
            Debug.Log("SpilSDK-Unity Init");

            Instance.SetPluginInformation(SpilUnityImplementationBase.PluginName, SpilUnityImplementationBase.PluginVersion);

#if UNITY_EDITOR
            InitEditor();
#endif

#if UNITY_IOS
            if (!string.IsNullOrEmpty(CustomBundleId))
            {
                Instance.SetCustomBundleId(CustomBundleId);
            }
#endif

#if UNITY_ANDROID
            //Check if Project Id is set
            if (ProjectId == null)
            {
                throw new UnityException(
                          "Project ID not set!! Please set your Project Id with the id provided by the Spil representative!");
            }
#endif

            UseUnityPrefab = useUnityPrefab;

            if (CheckPrivacyPolicy)
            {
                if (useUnityPrefab)
                {
                    Instance.CheckPrivacyPolicyUnity();
                }
                else
                {
                    Instance.CheckPrivacyPolicy();
                }
            }
            else
            {
                Instance.SpilInit(false);
            }

            gameObject.name = "SpilSDK";

#if !UNITY_EDITOR
            GameDataObject = new SpilGameDataHelper(Instance);
            GameData       = GameDataObject;

            PlayerDataObject = new PlayerDataHelper(Instance);
            PlayerData       = PlayerDataObject;
#endif
        }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        PlayerDataHelper test = new PlayerDataHelper();
        List<XElement> testFleet = test.loadFleets();
        List<XElement> testShip = test.loadShips("2");
        List<XElement> testCard = test.loadCards("4", "1");

        Debug.Log (testFleet[0].Attribute("name").Value);
        Debug.Log (testShip[0].Attribute("shipID").Value);
        Debug.Log (testCard[0].Attribute("cardID").Value);
    }