/// <summary>
        /// Initialises a new instance of the com.esendex.sdk.contacts.ContactCollection
        /// </summary>
        /// <param name="id">A com.esendex.sdk.contacts.Contact.Id instance that contains a contacts guid.</param>
        public ContactCollection(string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException("contact");
            }

            ItemsId.Add(id);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Switch Character weapon only use by companion and the player
        /// </summary>
        /// <param name="itemId"></param>
        public void SwitchWeapon(ItemsId itemId)
        {
            bool isLightOn = false;

            if (currentWeapon != null)
            {
                if (myWeaponLightSource != null)
                {
                    isLightOn = myWeaponLightSource.GetComponent <Light>().enabled;
                    TurnOffWeaponLight();
                }
                currentWeapon.SetActive(false);
            }
            Debug.Log("weaponList  count" + weaponList.Count);
            for (int z = 0; z < weaponList.Count; z++)
            {
                if (weaponList[z].GetComponent <MyWeapons>().weaponId == itemId)
                {
                    currentWeapon = weaponList[z];
                    myWeapons     = weaponList[z].GetComponent <MyWeapons>();
                    currentWeapon.SetActive(true);
                    if (currentWeapon.GetComponent <Collider>() != null)
                    {
                        myWeaponCollider = currentWeapon.GetComponent <Collider>();
                    }

                    if (myWeapons.weaponLight != null)
                    {
                        myWeaponLightSource = myWeapons.weaponLight;
                        if (isLightOn)
                        {
                            TurnOnWeaponLight();
                        }
                        else
                        {
                            TurnOffWeaponLight();
                        }
                    }

                    if (myBowController != null)
                    {
                        myBowController.theBowAnimator = myWeapons.theAnimator;
                    }
                    currentWeapon.SetActive(true);
                    break;
                }
            }
        }