Esempio n. 1
0
    public void LoadCharas(List <string> pathList, float posX = 0f, float posY = 4000f)
    {
        this.goCharaList = new List <GameObject>();
        this.cpParamList = new List <CharacterParams>();
        int num = 0;

        foreach (string text in pathList)
        {
            GameObject original = AssetDataMng.Instance().LoadObject(text, null, true) as GameObject;
            this.goCharaList.Add(UnityEngine.Object.Instantiate <GameObject>(original));
            CharacterParams component = this.goCharaList[num].GetComponent <CharacterParams>();
            component.PlayAnimation(CharacterAnimationType.idle, SkillType.Attack, 0, null, null);
            this.cpParamList.Add(component);
            this.goCharaList[num].name = text;
            this.goCharaList[num].transform.SetParent(this.Locater[num].transform.parent);
            this.goCharaList[num].transform.transform.localPosition = Vector3.zero;
            this.goCharaList[num].transform.transform.localScale    = Vector3.one;
            Vector3 previewCameraPosition = component.GetPreviewCameraPosition(this.cam.transform.parent);
            component.transform.position = this.cam.transform.position - previewCameraPosition + this.Locater[num].transform.position;
            component.transform.rotation = this.Locater[num].transform.rotation;
            num++;
        }
        base.gameObject.transform.localPosition = new Vector3(posX, posY, 0f);
    }