Ejemplo n.º 1
0
        /// <summary>
        /// Adds a loaded summon to the party
        /// </summary>
        /// <param name="summoner"> PartyMember summoning this </param>
        /// <param name="className"> Class of the summon (which is the unique ID) </param>
        /// <param name="ID"> Unique ID to be assigned to this summon </param>
        public void AddPartyMemberSummon(PartyMember summoner, string className, int ID)
        {
            GameObject  clone  = Instantiate(partyMember, new Vector3(0f, 0f, 0f), Quaternion.identity);
            PartyMember summon = clone.GetComponent <PartyMember>();

            summon.gameObject.transform.SetParent(gameObject.transform, false);
            summon.ID = ID;
            summon.InitSummon(summons.Find(s => s.className == className), summoner);

            partyMembersAlive.Add(summon);
            partyMembersAll.Add(summon);
            EventManager.instance.UpdatePartyMembers();
            summon.GetSummonBuff();     // have to add the buff AFTER the summon's pmvc is initted (so all visual components can be used)
        }