Example #1
0
        private void SelectRoleType()
        {
            switch ((EnumRoleTypeIndex)this.m_iRoleIndex)
            {
            case EnumRoleTypeIndex.e_RoleType_Engineer:
                this.m_iVocation = (int)EnumRoleTypeIndex.e_RoleType_Engineer;
                this.strRole     = "Bright";
                this.m_btGender  = 0;
                break;

            case EnumRoleTypeIndex.e_RoleType_Explorer:
                this.m_iVocation = (int)EnumRoleTypeIndex.e_RoleType_Explorer;
                this.strRole     = "Bright";
                this.m_btGender  = 0;
                break;

            case EnumRoleTypeIndex.e_RoleType_Cultivator:
                this.m_iVocation = (int)EnumRoleTypeIndex.e_RoleType_Cultivator;
                this.strRole     = "Bright";
                this.m_btGender  = 0;
                break;

            case EnumRoleTypeIndex.e_RoleType_Magician:
                this.m_iVocation = (int)EnumRoleTypeIndex.e_RoleType_Magician;
                this.strRole     = "Bright";
                this.m_btGender  = 1;
                break;
            }
            if (this.m_oCreateRoleObj != null)
            {
                if (this.m_spinObj)
                {
                    this.m_spinObj.m_target = null;
                }
                GameObject.Destroy(this.m_oCreateRoleObj);
                this.m_oCreateRoleObj = null;
                this.m_oEntityShow    = null;
            }
            GameObject obj = GameObject.Find("CharacterStandGround");

            this.m_oCreateRoleObj      = new GameObject();
            this.m_oCreateRoleObj.name = "CreateRole";
            this.m_oCreateRoleObj.transform.SetParent(GameObject.Find("pn_characterscene").transform);
            this.m_oCreateRoleObj.transform.localPosition = new Vector3(obj.transform.localPosition.x, -360, obj.transform.localPosition.z);
            this.m_oCreateRoleObj.transform.localRotation = Quaternion.Euler(0, 150, 0);
            this.m_oCreateRoleObj.transform.localScale    = new Vector3(300f, 300f, 300f);
            RoleAttachedInfo info = new RoleAttachedInfo();

            info.mGender       = this.m_btGender;
            info.mVocation     = (byte)this.m_iVocation;
            this.m_oEntityShow = new EntityShow();
            this.m_oEntityShow.SetEntityInfo(info);
            this.m_oEntityShow.Transform = this.m_oCreateRoleObj.transform;
            this.m_oEntityShow.SetVisiableWhenLoad(false);
            this.m_oEntityShow.OnEnterWorld();
            if (this.m_spinObj)
            {
                this.m_spinObj.m_target = (EntityShow)this.m_oEntityShow;
            }
        }
Example #2
0
    void Start()
    {
        ResourceManager.singleton.Init(this.GetComponent("GameResourceManager") as IResourceManager);
        GameWorld.Init();
        RoleAttachedInfo info = new RoleAttachedInfo();

        EventDispatch.TriggerEvent <RoleAttachedInfo>(Game.Event.FrameWorkEvent.EntityAttached, info);
    }
Example #3
0
        private static void OnEntityAttached(RoleAttachedInfo roleInfo)
        {
            bool ab = false;

            if (GameWorld.thePlayer == null)
            {
                ab        = true;
                thePlayer = new EntityMyself();
            }
            m_currentEntity = thePlayer;
            thePlayer.SetEntityInfo(roleInfo);
            if (ab)
            {
                thePlayer.OnEnterWorld();
            }
        }
 public void SetEntityInfo(RoleAttachedInfo info)
 {
     this.Vocation = (Vocation)info.mVocation;
     this.Level    = info.mLevel;
     this.Gender   = info.mGender;
 }