Example #1
0
    public void ReadObjectState(BinaryReader binaryReader)
    {
        //Get the subObjects count
        int simpleSubCount = binaryReader.ReadInt32();

        for (int subCount = 0; subCount < simpleSubCount; subCount++)
        {
            GameObject      simpleSub       = new GameObject();
            SimpleSubObject simpleSubScript = simpleSub.AddComponent <SimpleSubObject>();
            simpleSubScript.ReadObjectState(binaryReader);
            simpleSub.transform.parent = this.transform;
        }

        this.aStringObject = binaryReader.ReadString();
        this.aFloatValue   = binaryReader.ReadSingle();

        this.gameObject.name = binaryReader.ReadString();
    }
Example #2
0
    public void ReadObjectState_Web(string prependKey)
    {
        //Get the subObjects count
        int simpleSubCount = PlayerPrefs.GetInt(prependKey + "subObjectCount");

        for (int subCount = 0; subCount < simpleSubCount; subCount++)
        {
            GameObject      simpleSub       = new GameObject();
            SimpleSubObject simpleSubScript = simpleSub.AddComponent <SimpleSubObject>();
            simpleSubScript.ReadObjectState_Web(prependKey + subCount);
            simpleSub.transform.parent = this.transform;
        }

        this.aStringObject = PlayerPrefs.GetString(prependKey + "aStringObject");
        this.aFloatValue   = PlayerPrefs.GetFloat(prependKey + "aFloatValue");

        this.gameObject.name = PlayerPrefs.GetString(prependKey + "objectName");
    }
Example #3
0
    public void ReadObjectState(BinaryReader binaryReader)
    {
        CameraScript manager = GameObject.Find("_Manager").GetComponent <CameraScript>();
        //Get the subObjects count
        int simpleSubCount = binaryReader.ReadInt32();

        for (int subCount = 0; subCount < simpleSubCount; subCount++)
        {
            GameObject      simpleSub       = new GameObject();
            SimpleSubObject simpleSubScript = simpleSub.AddComponent <SimpleSubObject>();
            simpleSubScript.ReadObjectState(binaryReader);
            simpleSub.transform.parent = this.transform;
        }

        this.aStringObject = binaryReader.ReadString();
        this.aFloatValue   = binaryReader.ReadSingle();
        int bankAmount = binaryReader.ReadInt32();

        List <int> received = new List <int>();
        string     cards    = binaryReader.ReadString();

        foreach (string card in cards.Split(','))
        {
            int num;
            if (int.TryParse(card, out num))
            {
                received.Add(num);
            }
        }

        SaveCards(received);

        this.bankAmount = bankAmount;
        manager.SetBankText(bankAmount);
        this.gameObject.name = binaryReader.ReadString();
    }