Ejemplo n.º 1
0
        //--------------------------------------------------------------------------------
        // CallbackActorPlayerList
        //--------------------------------------------------------------------------------
        private void CallbackActorPlayerList(string[] result)
        {
            for (int i = 0; i < result.Length; ++i)
            {
                SActorPlayerPreview preview = JsonUtility.FromJson <SActorPlayerPreview>(result[i]);

                foreach (int aspectId in preview.sAspects)
                {
                    TemplateAspect tmpl;

                    if (DataManager.dictAspect.TryGetValue(aspectId, out tmpl))
                    {
                        if (_actorObject.Length > i && tmpl.actorPrefab)
                        {
                            _actorObject[i]      = Instantiate(tmpl.actorPrefab);
                            _actorObject[i].name = preview.sName;
                            _actorObject[i].transform.position = _actorPositionObject[i].transform.position;
                            _actorObject[i].transform.parent   = _actorPositionObject[i].transform;
                            _actorObject[i].AddComponent <SelectableActor>();
                            _actorObject[i].GetComponent <SelectableActor>().Init(this, preview.sName);

                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        // ===============================================================================
        // ACTOR PLAYER RELATED
        // ===============================================================================

        // -------------------------------------------------------------------------------
        // GetActorPlayerPreviews
        // -------------------------------------------------------------------------------
        public SActorPlayerPreview[] GetActorPlayerPreviews(string sName)
        {
            if (String.IsNullOrWhiteSpace(sName))
            {
                return(null);
            }

            List <string> names = GetActorNamesOnAccount(sName);

            SActorPlayerPreview[] previews = new SActorPlayerPreview[names.Count];

            for (int i = 0; i < names.Count; ++i)
            {
                GameObject go = ActorPlayerLoad(names[i]);

                if (go.GetComponent <MetaSubsystem>().IsValid)
                {
                    previews[i].sName    = names[i];
                    previews[i].sAspects = go.GetComponent <AspectSubsystem>().GetAspects();
                }
            }

            return(previews);
        }