Ejemplo n.º 1
0
    // Token: 0x06002366 RID: 9062 RVA: 0x0040FD48 File Offset: 0x0040DF48
    protected void createShadow(float radius)
    {
        AssetBundle assetBundle = AssetManager.GetAssetBundle("UI/shadow", out Soldier.shadowABKey, false);

        this.shadowObj = (UnityEngine.Object.Instantiate(assetBundle.mainAsset) as GameObject);
        this.shadowObj.transform.parent = this.transform;
        MeshFilter component = this.shadowObj.GetComponent <MeshFilter>();

        component.mesh = GameConstants.CreatePlane(this.transform.forward, this.transform.right, new Rect(0f, 0f, 1f, 1f), new Color(1f, 1f, 1f, 0.5f), radius);
    }
Ejemplo n.º 2
0
    // Token: 0x0600219C RID: 8604 RVA: 0x00401468 File Offset: 0x003FF668
    private void initCorpsStage()
    {
        ushort     num;
        CorpsStage recordByKey;

        if (DataManager.Instance.lastBattleResult == 1)
        {
            num         = DataManager.StageDataController.StageRecord[2];
            recordByKey = DataManager.StageDataController.CorpsStageTable.GetRecordByKey(num);
        }
        else
        {
            if (DataManager.StageDataController.StageRecord[2] >= DataManager.StageDataController.limitRecord[2])
            {
                if (this.CorpsStageGameObject != null)
                {
                    this.CorpsStageGameObject.SetActive(false);
                }
                return;
            }
            num         = DataManager.StageDataController.StageRecord[2] + 1;
            recordByKey = DataManager.StageDataController.CorpsStageTable.GetRecordByKey(num);
        }
        if (this.CorpsStageGameObject == null)
        {
            if (num != this.currentCorpsStageRecord)
            {
                this.currentCorpsStageRecord = num;
            }
            this.CorpsStageGameObject = new GameObject("CorpsStage");
        }
        else
        {
            if (num == this.currentCorpsStageRecord)
            {
                return;
            }
            this.currentCorpsStageRecord = num;
            this.CastleModelEff.transform.SetParent(null);
            this.CastleModel.transform.SetParent(null);
            this.LordModel.transform.SetParent(null);
            UnityEngine.Object.Destroy(this.LordModel);
            AssetManager.UnloadAssetBundle(this.LordassetKey, true);
            this.LordModel = null;
            AssetManager.UnloadAssetBundle(this.ShadowassetKey, true);
            this.ShadowassetKey = 0;
        }
        CString   cstring   = StringManager.Instance.SpawnString(30);
        Transform transform = this.CorpsStageGameObject.transform;

        transform.position = GameConstants.WordToVector3(recordByKey.CastlePos.X, recordByKey.CastlePos.Y, recordByKey.CastlePos.Z, -100, 0.01f);
        if (this.CastleModel == null)
        {
            cstring.ClearString();
            cstring.AppendFormat("Role/npccastle");
            AssetBundle assetBundle = AssetManager.GetAssetBundle(cstring, out this.CastleassetKey);
            this.CastleModel = (UnityEngine.Object.Instantiate(assetBundle.mainAsset) as GameObject);
        }
        Transform transform2 = this.CastleModel.transform;

        transform2.SetParent(transform);
        transform2.localScale = Vector3.one * (float)recordByKey.CastleScale * 0.01f;
        Vector3 eulerAngles = transform2.eulerAngles;

        eulerAngles.y          = (float)recordByKey.CastleRotY * 0.01f;
        transform2.eulerAngles = eulerAngles;
        transform2.position    = GameConstants.WordToVector3(recordByKey.CastlePos.X, recordByKey.CastlePos.Y, recordByKey.CastlePos.Z, -100, 0.01f);
        ushort num2 = 0;

        if (this.LordModel == null)
        {
            Hero   recordByKey2 = DataManager.Instance.HeroTable.GetRecordByKey(recordByKey.Heros[0].HeroID);
            ushort num3         = recordByKey2.Modle;
            if (!DataManager.Instance.CheckHero3DMesh(recordByKey.Heros[0].HeroID))
            {
                num3 = 1;
            }
            num2 = recordByKey2.Radius;
            cstring.ClearString();
            cstring.StringToFormat("Role/hero_");
            cstring.IntToFormat((long)num3, 5, false);
            cstring.AppendFormat("{0}{1}");
            AssetBundle assetBundle = AssetManager.GetAssetBundle(cstring, out this.LordassetKey);
            if (assetBundle)
            {
                this.LordModel = (UnityEngine.Object.Instantiate(assetBundle.Load("m")) as GameObject);
            }
        }
        if (this.LordModel)
        {
            transform2 = this.LordModel.transform;
        }
        transform2.SetParent(transform);
        transform2.localScale = Vector3.one * (float)recordByKey.LordScale * 0.01f;
        transform2.position   = GameConstants.WordToVector3(recordByKey.LordPos.X, recordByKey.LordPos.Y, recordByKey.LordPos.Z, -100, 0.01f);
        if (this.ShadowassetKey == 0)
        {
            AssetBundle assetBundle = AssetManager.GetAssetBundle("UI/shadow", out this.ShadowassetKey, false);
            GameObject  gameObject  = UnityEngine.Object.Instantiate(assetBundle.mainAsset) as GameObject;
            this.ShadowTransform = gameObject.transform;
            this.ShadowTransform.SetParent(transform2, false);
            MeshFilter component = gameObject.GetComponent <MeshFilter>();
            component.mesh        = GameConstants.CreatePlane(transform2.forward, transform2.right, new Rect(0f, 0f, 1f, 1f), new Color(1f, 1f, 1f, 0.6f), (float)num2 * 0.015f);
            this.LordBipTransform = transform2.GetChild(0);
        }
        ParticleManager.Instance.DeSpawn(this.CastleModelEff);
        this.CastleModelEff = ParticleManager.Instance.Spawn(309, transform, Vector3.zero, (float)recordByKey.CastleScale * 0.01f, true, true, true);
        this.CastleModelEff.SetActive(true);
        StringManager.Instance.DeSpawnString(cstring);
    }