Esempio n. 1
0
        public static Packet StorageOpen(Npc storageNpc, CharacterStorage charStorage)
        {
            Packet storageOpenPacket = new Packet(ServerOperationCode.Storage);

            storageOpenPacket
            .WriteByte((byte)NPCsConstants.StorageAction.OpenStorage)
            .WriteInt(storageNpc.MapleID)
            .WriteByte(charStorage.Slots)
            .WriteShort(126)
            .WriteShort()
            .WriteInt()
            .WriteInt(charStorage.Meso)
            .WriteShort()
            .WriteByte((byte)charStorage.Items.Count);

            foreach (Item item in charStorage.Items)
            {
                storageOpenPacket.WriteBytes(item.ToByteArray(true, true));
            }

            storageOpenPacket
            .WriteShort()
            .WriteByte();

            return(storageOpenPacket);
        }
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (instance != this)
     {
         Destroy(gameObject);
         Debug.LogWarning("An instance of CharacterStorage already exists");
     }
 }
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (instance != this)
        {
            Destroy(gameObject);
            Debug.LogWarning("An instance of RecolorManager already exists");
        }

        charStore = FindObjectOfType <CharacterStorage>();
    }
    //public static void StorePurchases(CharacterProfile[] chars){
    public static void StorePurchases(CharacterStorage storage)
    {
        string result = string.Empty;

        for (int i = 0; i < storage.characters.Length; i++)
        {
            if (storage.GetCharacter(i).isPurchased)
            {
                result += 1;
            }
            else
            {
                result += 0;
            }
        }
        PlayerPrefs.SetString("Chars" + curPlayer, result);
    }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        dropMgr     = FindObjectOfType <DropManager> ();
        charStorage = FindObjectOfType <CharacterStorage> ();

        SpawnChar(Persistence.currentChar);
        //Init ();
        charOrigin    = gameObject.transform.position;
        charOrigin.y += 1.25f;
        ClimberStateManager.Subscribe(this);

        stepUp    = charOrigin + Vector3.forward * 1.6f /*725f*/ + Vector3.down * 0.765f;
        stepUp.y += 1.25f;

        stepDown    = charOrigin + Vector3.back * 1.6f /*725f*/ + Vector3.up * 0.765f;
        stepDown.y -= 1.0f;

        rocket.SetActive(false);
    }
Esempio n. 6
0
    void Start()
    {
        stairCam  = GameObject.Find("StairCamera").GetComponent <Camera> ();
        bomb      = FindObjectOfType <BombController> ();
        character = FindObjectOfType <CharacterScript> ();
        charStore = FindObjectOfType <CharacterStorage> ();
        help      = FindObjectOfType <HelpController>();
        smHelp    = FindObjectOfType <SmallHelpButton> ();

        stairs = FindObjectOfType <StairController>();

        main = FindObjectOfType <GameController>();
        exp  = FindObjectOfType <XPController> ();

        FMC_Statistics.newPowerUp += RewardPerformance;

        types = new PickableItem.Type[drops.Length];
        for (int i = 0; i < types.Length; i++)
        {
            types [i] = drops [i].GetComponent <PickableItem> ().type;
        }
    }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        panel.SetActive(true);
        //shopAnim = panel.GetComponent<Animator>();
        storage = FindObjectOfType <CharacterStorage> ();
        main    = FindObjectOfType <GameController> ();
        items   = new List <ShopItem> ();
        bool[] purchases  = Persistence.GetPurchased();
        bool   isUnlocked = true;

        if (FMC_GameDataController.instance != null)
        {
            isUnlocked = FMC_GameDataController.instance.subscriptionIsActive();
        }
        for (int i = 0; i < storage.characters.Length; i++)
        {
            storage.GetCharacter(i).isLocked = !isUnlocked;

            if (purchases.Length > 0)
            {
                storage.GetCharacter(i).isPurchased = purchases [i];
            }
            else if (i > 0)
            {
                storage.GetCharacter(i).isPurchased = false;
            }
            SpawnItem(i);
        }
        if (purchases.Length == 0)
        {
            Save();
        }
        shopAnim.SetBool("IsOpen", true);
        curtainAnim.SetBool("IsOpen", true);
        panel.SetActive(false);
        curtainAnim.gameObject.SetActive(false);
    }
 void Start()
 {
     charStorage = FindObjectOfType <CharacterStorage>();
     recolor     = RecolorManager.Get();//FindObjectOfType<RecolorManager>();
     SpawnCurrent();
 }