//난투장에서 색깔변경
    public void ChangeNameColor()
    {
        List <long> AttackerList = (G_GameInfo.GameInfo as FreeFightGameInfo).KillAttackerRoleId;

        if (G_GameInfo.GameMode == GAME_MODE.FREEFIGHT && FreeFightGameState.GameMode == GAME_MODE.FREEFIGHT)
        {
            List <GameObject> objList = poolDic[ShowingType.Head];

            int loopCount = objList.Count;
            for (int i = 0; i < loopCount; i++)
            {
                GameObject obj  = objList[i];
                HeadObject head = obj.GetComponent <HeadObject>();

                head.ChangeNameColor(false);

                for (int j = 0; j < AttackerList.Count; j++)
                {
                    if (head.Owner as Pc && (ulong)AttackerList[j] == head.Owner.m_rUUID)
                    {
                        if (head != null)
                        {
                            head.ChangeNameColor(true);
                            break;
                        }
                    }
                }
            }
        }
    }
    public void ShowHead(GameObject target, string name, uint prefix, uint suffix, bool isMy)
    {
        if (TownState.TownActive)
        {
            return;
        }

        List <GameObject> objList = poolDic[ShowingType.Head];
        bool isCreate             = true;
        int  loopCount            = objList.Count;

        for (int i = 0; i < loopCount; i++)
        {
            GameObject obj  = objList[i];
            HeadObject head = obj.GetComponent <HeadObject>();
            if (head.Owner != null && head.Owner.cachedTransform == target.transform)//이미 등록되어 있는 유닛.
            {
                head.Show(target, name, prefix, suffix, isMy);
                return;
            }

            if (head.IsActivate)
            {
                continue;
            }

            isCreate = false;
            head.Show(target, name, prefix, suffix, isMy);
            break;
        }

        if (isCreate)
        {
            GameObject headObj = Instantiate(NamePrefab) as GameObject;
            headObj.transform.AttachTo(transform, true);
            headObj.SetActive(true);
            objList.Add(headObj);

            HeadObject head = headObj.GetComponent <HeadObject>();
            head.Show(target, name, prefix, suffix, isMy);
        }
    }
Esempio n. 3
0
 private void EnableCharacter()
 {
     GunObject.enabled = true;
     HeadObject.GetComponent <SpriteRenderer>().enabled = true;
     rigidbody2D.isKinematic = false;
 }
Esempio n. 4
0
 private void OnEnable()
 {
     activeHead = this;
 }