protected override void OnCreateModel()
    {
        data = AvatarModelData.GetByID(1);
        if (data == null)
        {
            Debuger.LogError("数据Error null" + serverInfo.dataId);
            return;
        }
        gameObject = Res.ResourceManager.Instance.Instantiate <GameObject>(GameCommonUtils.GetResourceData(data.prefabName).resourcePath);

        transform     = gameObject.transform;
        transform.tag = "Player";
        transform.gameObject.layer = 11;

        ActorMyself ap = gameObject.AddComponent <ActorMyself>();

        this.Motor           = gameObject.AddComponent <MotorMyself>();
        this.Motor.theEntity = this;
        ap.theEntity         = this;
        animator             = gameObject.GetComponent <Animator>();
        this.Actor           = ap;
        UpdatePosition();

        animator.applyRootMotion = false;


        gameObject.AddComponent <DontDestroyMe>();
        //ap.InitEquipment();
        ap.Equip(104001);
        ap.Equip(104002);

        if (data.scale > 0)
        {
            ap.transform.localScale = Vector3.one * data.scale;
        }

        GameObject light = Res.ResourceManager.Instance.Instantiate <GameObject>("Gear/RoundLight");

        light.transform.parent        = gameObject.transform;
        light.transform.localPosition = new Vector3(0, 1, 0);

        character = ap.GetComponent <CharacterController>();
    }
Beispiel #2
0
    public void DownloadLogin()
    {
        ActorMyself actor = m_myself.Actor as ActorMyself;

        actor.StartCoroutine(DownloadLoginMarket());
    }