Ejemplo n.º 1
0
    public void SetComposeUpgrade()
    {
        this.m_bEffectUpdate = true;
        if (null == this.rootEffectGameObject)
        {
            return;
        }
        this.SubEffectGameObject = null;
        string strName  = "fx_cut01";
        string strName2 = "fx_cut02";

        this.rootEffectGameObject.SetActive(false);
        GameObject gameObject = NkUtil.GetChild(this.rootEffectGameObject.transform, strName).gameObject;

        if (gameObject != null && this.m_bComposeTranscendence)
        {
            this.SubEffectGameObject = gameObject;
            this.SetLegendCardActive(gameObject);
        }
        GameObject gameObject2 = NkUtil.GetChild(this.rootEffectGameObject.transform, strName2).gameObject;

        if (gameObject2 != null && !this.m_bComposeTranscendence)
        {
            this.SubEffectGameObject = gameObject2;
            this.SetLegendCardActive(gameObject2);
        }
    }
Ejemplo n.º 2
0
        private void HideEffect()
        {
            if (this._costumeChar == null)
            {
                return;
            }
            Transform child = NkUtil.GetChild(this._costumeChar.transform, "fx_dummy");

            if (child == null)
            {
                return;
            }
            MeshRenderer[] componentsInChildren = child.GetComponentsInChildren <MeshRenderer>();
            if (componentsInChildren == null)
            {
                return;
            }
            MeshRenderer[] array = componentsInChildren;
            for (int i = 0; i < array.Length; i++)
            {
                MeshRenderer meshRenderer = array[i];
                if (!(meshRenderer == null))
                {
                    meshRenderer.enabled = false;
                }
            }
        }
Ejemplo n.º 3
0
    private void SetItemText()
    {
        if (!this.m_bComposeTranscendence)
        {
            if (this.SubEffectGameObject == null)
            {
                return;
            }
            GameObject gameObject = NkUtil.GetChild(this.SubEffectGameObject.transform, "fx_text_area").gameObject;
            if (gameObject != null)
            {
                Vector3 position = default(Vector3);
                position.x = gameObject.transform.position.x - 140f;
                position.y = gameObject.transform.position.y + 30f;
                position.z = gameObject.transform.position.z;
                this.solMovieText.gameObject.transform.position = position;
                string empty = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2837"),
                    "Count",
                    this.m_i32FailItemNum.ToString()
                });

                this.solMovieText.Visible = true;
                this.solMovieText.SetText(empty);
                this.solMovieText.SetCharacterSize(38f);
                this.solMovieText.SetMultiLine(false);
            }
        }
    }
Ejemplo n.º 4
0
 private void ShowCredit(WWWItem _item, object _param)
 {
     Main_UI_SystemMessage.CloseUI();
     if (this == null)
     {
         return;
     }
     if (null != _item.GetSafeBundle() && null != _item.GetSafeBundle().mainAsset)
     {
         GameObject gameObject = _item.GetSafeBundle().mainAsset as GameObject;
         if (null != gameObject)
         {
             this.rootGameObject = (UnityEngine.Object.Instantiate(gameObject) as GameObject);
             if (this == null)
             {
                 UnityEngine.Object.DestroyImmediate(this.rootGameObject);
                 return;
             }
             Vector2 screenPos   = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
             Vector3 effectUIPos = base.GetEffectUIPos(screenPos);
             effectUIPos.z = 90f;
             this.rootGameObject.transform.position = effectUIPos;
             NkUtil.SetAllChildLayer(this.rootGameObject, GUICamera.UILayer);
             this.childGameObject = NkUtil.GetChild(this.rootGameObject.transform, "fx_ending").gameObject;
             if (TsPlatform.IsMobile && TsPlatform.IsEditor)
             {
                 NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this.rootGameObject);
             }
         }
     }
 }
Ejemplo n.º 5
0
        private void SettingDirectionCharPortrait()
        {
            if (this._directionEffect == null)
            {
                Debug.LogError("ERROR, DirectionEffectSetter.cs, SettingDirectionCharPortrait(), CheckEffectAni is Null");
                return;
            }
            SolCombinationInfo_Data solCombinationDataByUniqeKey = NrTSingleton <NrSolCombinationSkillInfoManager> .Instance.GetSolCombinationDataByUniqeKey(this._solCombinationUniqeKey);

            if (solCombinationDataByUniqeKey == null || solCombinationDataByUniqeKey.m_szCombinationIsCharCode == null)
            {
                return;
            }
            int solCombinationCharCount = this.GetSolCombinationCharCount(solCombinationDataByUniqeKey.m_szCombinationIsCharCode);

            for (int i = 0; i < solCombinationCharCount; i++)
            {
                Transform child = NkUtil.GetChild(this._directionEffect.transform, "fx_hero_0" + (i + 1).ToString());
                if (!(child == null))
                {
                    child.gameObject.SetActive(true);
                    TsMeshCharPortraitSetter tsMeshCharPortraitSetter = child.gameObject.AddComponent <TsMeshCharPortraitSetter>();
                    tsMeshCharPortraitSetter.SetTexture(solCombinationDataByUniqeKey.m_szCombinationIsCharCode[i]);
                }
            }
        }
Ejemplo n.º 6
0
 private void SetUVPosition(int nNumberCount, int nDamage, bool bDodge, NkBattleDamage.eDAMAGEMODE eMode)
 {
     if (bDodge)
     {
         return;
     }
     char[] array = nDamage.ToString().ToCharArray();
     for (int i = 0; i < nNumberCount; i++)
     {
         int       num     = int.Parse(array[i].ToString());
         string    strName = string.Format("number{0}", (i + 1).ToString());
         Transform child   = NkUtil.GetChild(this.m_goFxFont.transform, strName);
         if (child != null)
         {
             GameObject gameObject = child.gameObject;
             if (gameObject)
             {
                 Rect rect = new Rect(NkBattleDamage.m_rtDamage[(int)eMode]);
                 rect.x += rect.width * (float)num;
                 Vector2[] uv = new Vector2[]
                 {
                     new Vector2(rect.x, rect.y),
                     new Vector2(rect.x + rect.width, rect.y - rect.height),
                     new Vector2(rect.x, rect.y - rect.height),
                     new Vector2(rect.x + rect.width, rect.y)
                 };
                 MeshFilter component = gameObject.GetComponent <MeshFilter>();
                 if (component != null)
                 {
                     component.mesh.uv = uv;
                 }
             }
         }
     }
 }
Ejemplo n.º 7
0
 public void _OnEffectProcess(IDownloadedItem wItem, object obj)
 {
     if (wItem != null && wItem.canAccessAssetBundle)
     {
         GameObject gameObject = wItem.GetSafeBundle().mainAsset as GameObject;
         if (null != gameObject)
         {
             this.m_gbEffect = (UnityEngine.Object.Instantiate(gameObject) as GameObject);
             Vector2 screenPos   = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
             Vector3 effectUIPos = base.GetEffectUIPos(screenPos);
             this.m_gbEffect.transform.position = effectUIPos;
             NkUtil.SetAllChildLayer(this.m_gbEffect, GUICamera.UILayer);
             if (TsPlatform.IsMobile && TsPlatform.IsEditor)
             {
                 NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this.m_gbEffect);
             }
             this.m_fCloseTime = Time.time + 5f;
             Transform child = NkUtil.GetChild(this.m_gbEffect.transform, "fx_character");
             if (null != child)
             {
                 this.SetCharFace(child, this.m_iChangeCharKind);
             }
         }
     }
     if (wItem.mainAsset == null)
     {
         TsLog.LogWarning("wItem.mainAsset is null -> Path = {0}", new object[]
         {
             wItem.assetPath
         });
     }
 }
Ejemplo n.º 8
0
    public void CameraDataRestore()
    {
        if (!NrBattleCamera.m_BackupCameraData.checkbackup)
        {
            return;
        }
        GameObject gameObject = TsSceneSwitcher.Instance._GetSwitchData_RootSceneGO(TsSceneSwitcher.ESceneType.BattleScene);

        if (gameObject == null)
        {
            return;
        }
        Transform child = NkUtil.GetChild(gameObject.transform, "Main Camera");

        if (child == null)
        {
            return;
        }
        maxCamera component = child.GetComponent <maxCamera>();

        component.distance        = NrBattleCamera.m_BackupCameraData.distance;
        component.xDeg            = NrBattleCamera.m_BackupCameraData.xDeg;
        component.yDeg            = NrBattleCamera.m_BackupCameraData.yDeg;
        component.currentDistance = NrBattleCamera.m_BackupCameraData.currentDistance;
        component.desiredDistance = NrBattleCamera.m_BackupCameraData.desiredDistance;
        component.m_nCameraLevel  = NrBattleCamera.m_BackupCameraData.CameraLevel;
        NrBattleCamera.m_BackupCameraData.trParent = null;
        component.RestoreBattleCamera();
    }
Ejemplo n.º 9
0
    private void SetImageAtTarget(Texture2D texture, string childObjName)
    {
        if (texture == null || string.IsNullOrEmpty(childObjName))
        {
            return;
        }
        GameObject gameObject = NkUtil.GetChild(this._directionObj.transform, childObjName).gameObject;

        if (gameObject == null)
        {
            return;
        }
        Material material = new Material(Shader.Find("Transparent/Vertex Colored" + NrTSingleton <UIDataManager> .Instance.AddFilePath));

        if (material == null)
        {
            return;
        }
        material.mainTexture = texture;
        if (gameObject.renderer == null)
        {
            return;
        }
        gameObject.renderer.sharedMaterial = material;
    }
Ejemplo n.º 10
0
    private void SetBackImage(WWWItem _item, object _param)
    {
        if (null == _item.GetSafeBundle())
        {
            return;
        }
        if (null == _item.GetSafeBundle().mainAsset)
        {
            return;
        }
        GameObject gameObject = _item.GetSafeBundle().mainAsset as GameObject;

        if (null != gameObject)
        {
            this.m_rootGameObject     = (UnityEngine.Object.Instantiate(gameObject) as GameObject);
            this.m_rootGameObject.tag = NrTSingleton <UIDataManager> .Instance.UIBundleTag;
            Vector2 screenPos   = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
            Vector3 effectUIPos = base.GetEffectUIPos(screenPos);
            effectUIPos.z = 300f;
            this.m_rootGameObject.transform.position = effectUIPos;
            NkUtil.SetAllChildLayer(this.m_rootGameObject, GUICamera.UILayer);
            this.m_goldenEgg = NkUtil.GetChild(this.m_rootGameObject.transform, "fx_goldegg").gameObject;
            this.m_whiiteEgg = NkUtil.GetChild(this.m_rootGameObject.transform, "fx_whiteegg").gameObject;
            if (TsPlatform.IsMobile && TsPlatform.IsEditor)
            {
                NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this.m_rootGameObject);
            }
        }
    }
Ejemplo n.º 11
0
    public void SetLoopPlay()
    {
        if (null == this.rootEffectGameObject)
        {
            return;
        }
        if (!this.m_bComposeTranscendence)
        {
            return;
        }
        GameObject gameObject = NkUtil.GetChild(this.rootEffectGameObject.transform, "loops").gameObject;

        if (gameObject != null)
        {
            gameObject.SetActive(true);
        }
        GameObject gameObject2 = NkUtil.GetChild(this.rootEffectGameObject.transform, "square_mesh_loop_2").gameObject;

        if (gameObject2 != null)
        {
            gameObject2.SetActive(false);
        }
        if (TsPlatform.IsMobile && TsPlatform.IsEditor)
        {
            NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this.rootEffectGameObject);
        }
    }
Ejemplo n.º 12
0
    public bool SetRankTextTexture(string strfaceImage, string faceObjName)
    {
        if (this.SubEffectGameObject == null)
        {
            return(false);
        }
        GameObject gameObject = NkUtil.GetChild(this.SubEffectGameObject.transform, faceObjName).gameObject;

        if (null != gameObject)
        {
            Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(strfaceImage);

            if (null != texture)
            {
                Material material = new Material(Shader.Find("Transparent/Vertex Colored" + NrTSingleton <UIDataManager> .Instance.AddFilePath));
                if (null != material)
                {
                    material.mainTexture = texture;
                    if (null != gameObject.renderer)
                    {
                        gameObject.renderer.sharedMaterial = material;
                        return(true);
                    }
                }
            }
        }
        return(true);
    }
Ejemplo n.º 13
0
 private void EquipItem(WWWItem _item, object _param)
 {
     Main_UI_SystemMessage.CloseUI();
     if (this == null)
     {
         return;
     }
     if (null != _item.GetSafeBundle() && null != _item.GetSafeBundle().mainAsset)
     {
         GameObject gameObject = _item.GetSafeBundle().mainAsset as GameObject;
         if (null != gameObject)
         {
             this.m_RootObject     = (UnityEngine.Object.Instantiate(gameObject) as GameObject);
             this.m_RootObject.tag = NrTSingleton <UIDataManager> .Instance.UIBundleTag;
             if (this == null)
             {
                 UnityEngine.Object.Destroy(this.m_RootObject);
                 return;
             }
             this.m_AniObject = NkUtil.GetChild(this.m_RootObject.transform, "fx_direct_weapon").gameObject;
             Vector2 screenPos   = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
             Vector3 effectUIPos = base.GetEffectUIPos(screenPos);
             effectUIPos.z = 100f;
             this.m_RootObject.transform.position = effectUIPos;
             NkUtil.SetAllChildLayer(this.m_RootObject, GUICamera.UILayer);
             this.m_fStartTime = Time.realtimeSinceStartup;
             if (TsPlatform.IsMobile && TsPlatform.IsEditor)
             {
                 NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this.m_RootObject);
             }
         }
     }
 }
Ejemplo n.º 14
0
    private void _funcUIEffectDownloaded(IDownloadedItem wItem, object obj)
    {
        Main_UI_SystemMessage.CloseUI();
        if (null == wItem.mainAsset)
        {
            TsLog.LogWarning("wItem.mainAsset is null -> Path = {0}", new object[]
            {
                wItem.assetPath
            });
            return;
        }
        GameObject gameObject = wItem.mainAsset as GameObject;

        if (null == gameObject)
        {
            return;
        }
        if (null != this.m_SlotEffect)
        {
            UnityEngine.Object.Destroy(this.m_SlotEffect);
        }
        this.m_SlotEffect = (GameObject)UnityEngine.Object.Instantiate(gameObject, Vector3.zero, Quaternion.identity);
        if (null == this.m_SlotEffect)
        {
            return;
        }
        Vector2 screenPos   = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
        Vector3 effectUIPos = base.GetEffectUIPos(screenPos);

        effectUIPos.z = 300f;
        this.m_SlotEffect.transform.position = effectUIPos;
        NkUtil.SetAllChildLayer(this.m_SlotEffect, GUICamera.UILayer);
        if (this.m_bSuccess)
        {
            GameObject gameObject2 = NkUtil.GetChild(this.m_SlotEffect.transform, "fx_sucess").gameObject;
            if (null != gameObject2)
            {
                gameObject2.SetActive(true);
            }
            effectUIPos.x += 2.8f;
            effectUIPos.y += 26f;
            this.m_SlotEffect.transform.position = effectUIPos;
            TsAudioManager.Container.RequestAudioClip("UI_SFX", "EQUIPMENT-UP", "SUCCESS", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay));
        }
        else
        {
            GameObject gameObject3 = NkUtil.GetChild(this.m_SlotEffect.transform, "fx_fail").gameObject;
            if (null != gameObject3)
            {
                gameObject3.SetActive(true);
            }
            TsAudioManager.Container.RequestAudioClip("UI_SFX", "EQUIPMENT-UP", "FAIL", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay));
        }
        if (TsPlatform.IsMobile && TsPlatform.IsEditor)
        {
            NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this.m_SlotEffect);
        }
        this.m_fStartTime = Time.realtimeSinceStartup;
    }
Ejemplo n.º 15
0
    private void ShowResultFx()
    {
        if (Battle.BATTLE.ResultEffect != null)
        {
            this.m_goResultFX = (GameObject)UnityEngine.Object.Instantiate(Battle.BATTLE.ResultEffect, Vector3.zero, Quaternion.identity);
            this.m_goResultFX.SetActive(true);
            NkUtil.SetAllChildLayer(this.m_goResultFX, GUICamera.UILayer);
            Vector2 screenPos = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
            this.m_goResultFX.transform.position = base.GetEffectUIPos(screenPos);
            this.m_goResultFX.SetActive(true);
            Transform child = NkUtil.GetChild(this.m_goResultFX.transform, "result");
            if (child != null)
            {
                Animation component = child.GetComponent <Animation>();
                if (component != null)
                {
                    if (component.isPlaying)
                    {
                        component.Stop();
                    }
                    AnimationClip clip;
                    if (this.m_ChildDlg.m_bWin)
                    {
                        clip = component.GetClip("victory");
                        component.Play("victory");
                        NrSound.ImmedatePlay("UI_SFX", "BATTLE", "WIN", true);
                    }
                    else
                    {
                        clip = component.GetClip("defeat");
                        component.Play("defeat");
                        NrSound.ImmedatePlay("UI_SFX", "BATTLE", "LOSE", true);
                    }
                    if (clip != null)
                    {
                        this.m_fResultFxTime = Time.realtimeSinceStartup + clip.length;
                    }
                    else
                    {
                        this.m_fResultFxTime = Time.realtimeSinceStartup - 1.5f;
                    }
                }
            }
            this.m_OpenTime = 0f;
        }
        else
        {
            this.m_dtWinLose.Visible = true;
            this.m_OpenTime          = Time.realtimeSinceStartup;
            this.m_fResultFxTime     = 0f;
            UnityEngine.Object.Destroy(this.m_goResultFX);
            if (!this.m_bClearMiddleStage)
            {
                NrTSingleton <NkClientLogic> .Instance.SetClearMiddleStage();

                this.m_bClearMiddleStage = true;
            }
        }
    }
    public override void Update()
    {
        base.Update();
        if (this.m_fEndTime != 0f && Time.realtimeSinceStartup > this.m_fEndTime && this.m_goKillEffect != null)
        {
            UnityEngine.Object.Destroy(this.m_goKillEffect);
            this.m_goKillEffect = null;
        }
        if (this.m_fCriticalEndTime != 0f && Time.realtimeSinceStartup > this.m_fCriticalEndTime && this.m_goCriticalEffect != null)
        {
            UnityEngine.Object.Destroy(this.m_goCriticalEffect);
            this.m_goCriticalEffect = null;
        }
        if (!this.m_bSetFace)
        {
            Transform child = NkUtil.GetChild(this.m_goSummonEffect.transform, "fx_face_base");
            if (child != null)
            {
                GameObject gameObject = child.gameObject;
                if (null != gameObject)
                {
                    Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.faceImageKey);

                    if (null != texture)
                    {
                        Renderer component = gameObject.GetComponent <Renderer>();
                        if (component != null)
                        {
                            Material material = component.material;
                            if (null != material)
                            {
                                material.mainTexture = texture;
                                this.m_bSetFace      = true;
                                this.m_goSummonEffect.SetActive(true);
                                TsAudioManager.Instance.AudioContainer.RequestAudioClip("UI_SFX", "BATTLE", "HERO_CALL", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay));
                                Animation componentInChildren = this.m_goSummonEffect.GetComponentInChildren <Animation>();
                                if (componentInChildren != null)
                                {
                                    this.m_fSummonEndTime = Time.realtimeSinceStartup + componentInChildren.clip.length;
                                    componentInChildren.Stop();
                                    componentInChildren.Play();
                                }
                                else
                                {
                                    this.m_fSummonEndTime = Time.realtimeSinceStartup + 1.5f;
                                }
                            }
                        }
                    }
                }
            }
        }
        else if (this.m_fSummonEndTime != 0f && this.m_fSummonEndTime < Time.realtimeSinceStartup && this.m_goSummonEffect != null)
        {
            UnityEngine.Object.Destroy(this.m_goSummonEffect);
            this.m_goSummonEffect = null;
            this.m_fSummonEndTime = 0f;
        }
    }
    public void SetEffect()
    {
        Transform child = NkUtil.GetChild(this.m_dtProduct_Effect.gameObject.transform, "child_effect");

        if (child == null)
        {
            NrTSingleton <FormsManager> .Instance.AttachEffectKey(EffectDefine.FX_ITEMMALL_PRODUCT, this.m_dtProduct_Effect, this.m_dtProduct_Effect.GetSize());
        }
    }
Ejemplo n.º 18
0
 public void SetSlowMotionCamera(NkBattleChar pkTarget, bool bSet)
 {
     if (bSet)
     {
         if (NrBattleCamera.m_BackupCameraData.checkbackup && NrBattleCamera.m_BackupCameraData.trParent != null)
         {
             return;
         }
         if (pkTarget == null)
         {
             return;
         }
         GameObject gameObject = TsSceneSwitcher.Instance._GetSwitchData_RootSceneGO(TsSceneSwitcher.ESceneType.BattleScene);
         if (gameObject == null)
         {
             return;
         }
         Transform child = NkUtil.GetChild(gameObject.transform, "Main Camera");
         if (child == null)
         {
             return;
         }
         maxCamera component = child.GetComponent <maxCamera>();
         if (component == null)
         {
             return;
         }
         NrBattleCamera.m_BackupCameraData.CameraLevel = component.m_nCameraLevel;
         NrBattleCamera.m_BackupCameraData.checkbackup = true;
         component.m_nCameraLevel = 4;
         component.SetLevelValue();
         this.m_veTriggerStartPos = this.m_TargetGo.transform.position;
         this.SetcameraPos(pkTarget.GetCharPos());
     }
     else if (NrBattleCamera.m_BackupCameraData.checkbackup && NrBattleCamera.m_BackupCameraData.trParent == null)
     {
         GameObject gameObject2 = TsSceneSwitcher.Instance._GetSwitchData_RootSceneGO(TsSceneSwitcher.ESceneType.BattleScene);
         if (gameObject2 == null)
         {
             return;
         }
         Transform child2 = NkUtil.GetChild(gameObject2.transform, "Main Camera");
         if (child2 == null)
         {
             return;
         }
         maxCamera component2 = child2.GetComponent <maxCamera>();
         if (component2 == null)
         {
             return;
         }
         component2.m_nCameraLevel = NrBattleCamera.m_BackupCameraData.CameraLevel;
         component2.SetLevelValue();
         NrBattleCamera.m_BackupCameraData.checkbackup = false;
         this.SetcameraPos(this.m_veTriggerStartPos);
     }
 }
Ejemplo n.º 19
0
    private void AttachControllers()
    {
        CharacterController characterController = NkUtil.GuarranteeComponent <CharacterController>(this.m_kRootGameObj);
        CapsuleCollider     componentInChildren = this.m_kBaseObject.GetComponentInChildren <CapsuleCollider>();

        if (null != componentInChildren)
        {
            characterController.radius     = 0.1f;
            characterController.height     = componentInChildren.height;
            characterController.center     = new Vector3(0f, characterController.height / 2f, 0f);
            characterController.slopeLimit = 45f;
            characterController.stepOffset = 0.8f;
            UnityEngine.Object.DestroyObject(componentInChildren);
        }
        else
        {
            characterController.radius = 0.1f;
            this.m_pkPickingCollider   = NkUtil.GetChild(this.m_kRootGameObj.transform, "PickingCollider");
            if (this.m_pkPickingCollider != null)
            {
                BoxCollider component = this.m_pkPickingCollider.GetComponent <BoxCollider>();
                if (component != null)
                {
                    characterController.height = component.size.y;
                }
                else
                {
                    characterController.height = 1f;
                }
            }
            else
            {
                characterController.height = 1f;
            }
            characterController.center     = new Vector3(0f, characterController.height / 2f, 0f);
            characterController.slopeLimit = 45f;
            characterController.stepOffset = 0.8f;
        }
        if (this.m_kBaseObject != null)
        {
            Transform child = NkUtil.GetChild(this.m_kBaseObject.transform, "Camera");
            if (child == null)
            {
                GameObject gameObject = new GameObject("Camera");
                Vector3    a          = characterController.center;
                a.y += characterController.height / 4f;
                a   += this.m_kBaseObject.transform.position;
                Vector3 vector = this.m_kBaseObject.transform.position;
                vector  += this.m_kBaseObject.transform.forward * 2f;
                vector.y = Mathf.Max(0.3f, a.y);
                gameObject.transform.localPosition = vector;
                gameObject.transform.parent        = this.m_kBaseObject.transform;
            }
        }
        this.m_kCharacterCtrl = characterController;
    }
Ejemplo n.º 20
0
    private void _funcUIEffectDownloaded(IDownloadedItem wItem, object obj)
    {
        Main_UI_SystemMessage.CloseUI();
        if (null == wItem.mainAsset)
        {
            TsLog.LogWarning("wItem.mainAsset is null -> Path = {0}", new object[]
            {
                wItem.assetPath
            });
            return;
        }
        GameObject gameObject = wItem.mainAsset as GameObject;

        if (null == gameObject)
        {
            return;
        }
        this.SlotEffect = (GameObject)UnityEngine.Object.Instantiate(gameObject, Vector3.zero, Quaternion.identity);
        if (null == this.SlotEffect)
        {
            return;
        }
        Vector2 screenPos   = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
        Vector3 effectUIPos = base.GetEffectUIPos(screenPos);

        effectUIPos.z = 300f;
        this.SlotEffect.transform.position = effectUIPos;
        NkUtil.SetAllChildLayer(this.SlotEffect, GUICamera.UILayer);
        if (this.m_bItemUpgradeSuccess)
        {
            GameObject gameObject2 = NkUtil.GetChild(this.SlotEffect.transform, "fx_sucess").gameObject;
            if (null != gameObject2)
            {
                gameObject2.SetActive(true);
            }
            effectUIPos.x += 2.8f;
            effectUIPos.y += 26f;
            this.SlotEffect.transform.position = effectUIPos;
        }
        else
        {
            GameObject gameObject3 = NkUtil.GetChild(this.SlotEffect.transform, "fx_fail").gameObject;
            if (null != gameObject3)
            {
                gameObject3.SetActive(true);
            }
        }
        if (TsPlatform.IsMobile && TsPlatform.IsEditor)
        {
            NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this.SlotEffect);
        }
        if (null != this.SlotEffect)
        {
            UnityEngine.Object.DestroyObject(this.SlotEffect, 5f);
        }
    }
    public override void Update()
    {
        base.Update();
        if (this.m_goSkillDirecting == null)
        {
            return;
        }
        this.CloseUpdate();
        if (!this.m_bSetFace)
        {
            Transform child;
            if (this.m_bRival)
            {
                child = NkUtil.GetChild(this.m_goSkillDirecting.transform, "fx_boss");
            }
            else
            {
                child = NkUtil.GetChild(this.m_goSkillDirecting.transform, "fx_face_base");
            }
            if (child != null)
            {
                GameObject gameObject = child.gameObject;
                if (null != gameObject)
                {
                    Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.faceImageKey);

                    if (null != texture)
                    {
                        Renderer component = gameObject.GetComponent <Renderer>();
                        if (component != null)
                        {
                            Material material = component.material;
                            if (null != material)
                            {
                                material.mainTexture = texture;
                                this.m_bSetFace      = true;
                                this.m_goSkillDirecting.SetActive(true);
                                Animation componentInChildren = this.m_goSkillDirecting.GetComponentInChildren <Animation>();
                                if (componentInChildren != null)
                                {
                                    this.m_fEndTime = Time.time + componentInChildren.clip.length + 0.1f;
                                    componentInChildren.Stop();
                                    componentInChildren.Play();
                                }
                                else
                                {
                                    this.m_fEndTime = 0f;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 22
0
    public override void SetComponent()
    {
        this.m_laBoxTitle = (base.GetControl("Label_Title") as Label);
        this.m_dtMainBG   = (base.GetControl("DrawTexture_ImageBG") as DrawTexture);
        this.m_dtMainBG.SetTextureFromBundle("UI/Etc/rarebox");
        this.m_dtMainBG.Hide(false);
        this.m_ivMainBoxItem = (base.GetControl("DrawTexture_Item") as DrawTexture);
        if (this.m_ivMainBoxItem != null)
        {
            Transform child = NkUtil.GetChild(this.m_ivMainBoxItem.gameObject.transform, "child_effect");
            if (child == null)
            {
                NrTSingleton <FormsManager> .Instance.AttachEffectKey("FX_UI_BOXOPEN", this.m_ivMainBoxItem, this.m_ivMainBoxItem.GetSize());

                this.m_ivMainBoxItem.AddGameObjectDelegate(new EZGameObjectDelegate(this.effectBoxOpen));
            }
        }
        this.m_btUseBoxItem = (base.GetControl("Button_OK") as Button);
        this.m_btUseBoxItem.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickUseBoxItem));
        this.m_btUseBoxItem.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("573"));
        this.m_NlbItemListBox         = (base.GetControl("NewListBox_Item") as NewListBox);
        this.m_NlbItemListBox.Reserve = false;
        this.m_flToolTip1             = (base.GetControl("FlashLabel_Tooltip1") as FlashLabel);
        this.m_flToolTip2             = (base.GetControl("FlashLabel_Tooltip2") as FlashLabel);
        this.m_flToolTip3             = (base.GetControl("FlashLabel_Tooltip3") as FlashLabel);
        this.m_btSlide1 = (base.GetControl("Button_Slide1") as Button);
        this.m_btSlide1.SetLocation(this.m_btSlide1.GetLocation().x, this.m_btSlide1.GetLocationY(), this.m_btSlide1.GetLocation().z - 1.1f);
        this.m_btSlide2 = (base.GetControl("Button_Slide2") as Button);
        this.m_btSlide2.SetLocation(this.m_btSlide2.GetLocation().x, this.m_btSlide2.GetLocationY(), this.m_btSlide2.GetLocation().z - 1.1f);
        BoxCollider boxCollider = (BoxCollider)this.m_btSlide1.gameObject.GetComponent(typeof(BoxCollider));

        if (boxCollider != null)
        {
            boxCollider.size = new Vector3(0f, 0f, 0f);
        }
        boxCollider = (BoxCollider)this.m_btSlide2.gameObject.GetComponent(typeof(BoxCollider));
        if (boxCollider != null)
        {
            boxCollider.size = new Vector3(0f, 0f, 0f);
        }
        this.m_dwSlideBG1 = (base.GetControl("DrawTexture_SlideBG1") as DrawTexture);
        this.m_dwSlideBG2 = (base.GetControl("DrawTexture_SlideBG2") as DrawTexture);
        this.m_dwSlideBG1.SetLocation(this.m_dwSlideBG1.GetLocation().x, this.m_dwSlideBG1.GetLocationY(), this.m_dwSlideBG1.GetLocation().z - 1f);
        this.m_dwSlideBG2.SetLocation(this.m_dwSlideBG2.GetLocation().x, this.m_dwSlideBG2.GetLocationY(), this.m_dwSlideBG2.GetLocation().z - 1f);
        this.m_btSlide1.Hide(true);
        this.m_dwSlideBG1.Hide(true);
        this.m_laSelectItemName  = (base.GetControl("Label_Item") as Label);
        this.m_laSelectItemCount = (base.GetControl("Label_Count") as Label);
        this.m_flToolTip4        = (base.GetControl("FlashLabel_Tooltip4") as FlashLabel);
        this.m_flToolTip5        = (base.GetControl("FlashLabel_Tooltip5") as FlashLabel);
        this.m_flToolTip6        = (base.GetControl("FlashLabel_Tooltip6") as FlashLabel);
        base.SetScreenCenter();
    }
Ejemplo n.º 23
0
    private void SolRecruitDummySuccess(WWWItem _item, object _param)
    {
        Main_UI_SystemMessage.CloseUI();
        if (this == null)
        {
            return;
        }
        if (_item.GetSafeBundle() == null || _item.GetSafeBundle().mainAsset == null)
        {
            return;
        }
        GameObject gameObject = _item.GetSafeBundle().mainAsset as GameObject;

        if (gameObject == null)
        {
            return;
        }
        this._directionObj     = (UnityEngine.Object.Instantiate(gameObject) as GameObject);
        this._directionObj.tag = NrTSingleton <UIDataManager> .Instance.UIBundleTag;
        Vector2 screenPos   = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
        Vector3 effectUIPos = base.GetEffectUIPos(screenPos);

        effectUIPos.z = base.InteractivePanel.transform.position.z - 10f;
        this._directionObj.transform.position = effectUIPos;
        NkUtil.SetAllChildLayer(this._directionObj, GUICamera.UILayer);
        GameObject gameObject2 = NkUtil.GetChild(this._directionObj.transform, "fx_direct_dragonhero").gameObject;

        if (gameObject2 != null)
        {
            gameObject2.SetActive(true);
        }
        if (TsPlatform.IsMobile && TsPlatform.IsEditor)
        {
            NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this._directionObj);
        }
        Animation[] componentsInChildren = this._directionObj.GetComponentsInChildren <Animation>();
        Animation[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            Animation animation = array[i];
            if (!(animation == null))
            {
                if (animation.cullingType != AnimationCullingType.AlwaysAnimate)
                {
                    animation.cullingType = AnimationCullingType.AlwaysAnimate;
                }
            }
        }
        this.CreateCloseButton();
        this.SetDirectionDummySoldier();
    }
Ejemplo n.º 24
0
 public static void SetStaticData()
 {
     if (NkBattleDamage.m_rtDamage == null)
     {
         Texture    texture    = null;
         GameObject gameObject = NkUtil.GetChild(Battle.BATTLE.DamageEffect.transform, "number1").gameObject;
         if (gameObject != null)
         {
             MeshRenderer component = gameObject.GetComponent <MeshRenderer>();
             if (component != null)
             {
                 texture = component.material.mainTexture;
             }
         }
         float num  = (float)texture.width;
         float num2 = (float)texture.height;
         NkBattleDamage.m_rtDamage           = new Rect[6];
         NkBattleDamage.m_fNumberSizeWidth  *= num / 1024f;
         NkBattleDamage.m_fNumberSizeHeight *= num2 / 256f;
         for (int i = 0; i < 6; i++)
         {
             float top = 1f - (float)i * NkBattleDamage.m_fNumberSizeHeight / num2;
             NkBattleDamage.m_rtDamage[i] = new Rect(0f, top, NkBattleDamage.m_fNumberSizeWidth / num, NkBattleDamage.m_fNumberSizeHeight / num2);
         }
     }
     if (NkBattleDamage.m_strStartAniSequence == null)
     {
         NkBattleDamage.m_strStartAniSequence    = new string[6];
         NkBattleDamage.m_strStartAniSequence[0] = "fx_criscaleup";
         NkBattleDamage.m_strStartAniSequence[1] = "fx_normalscaleup";
         NkBattleDamage.m_strStartAniSequence[2] = "fx_healscaleup";
         NkBattleDamage.m_strStartAniSequence[3] = "fx_angryscaleup";
         NkBattleDamage.m_strStartAniSequence[4] = "fx_sleepscaleup";
         NkBattleDamage.m_strStartAniSequence[5] = "fx_stunscaleup";
     }
     if (NkBattleDamage.goDamageParent != null)
     {
         UnityEngine.Object.Destroy(NkBattleDamage.goDamageParent);
         NkBattleDamage.goDamageParent = null;
     }
     if (NkBattleDamage.goDamageParent == null)
     {
         NkBattleDamage.goDamageParent = new GameObject("DamageRoot");
         GameObject gameObject2 = TsSceneSwitcher.Instance._GetSwitchData_RootSceneGO(TsSceneSwitcher.ESceneType.BattleScene);
         if (gameObject2 == null)
         {
             return;
         }
         NkBattleDamage.goDamageParent.transform.parent = gameObject2.transform;
     }
 }
Ejemplo n.º 25
0
    private void PlayAni(WWWItem _item, object _param)
    {
        Main_UI_SystemMessage.CloseUI();
        if (this == null)
        {
            return;
        }
        if (null != _item.GetSafeBundle() && null != _item.GetSafeBundle().mainAsset)
        {
            GameObject gameObject = _item.GetSafeBundle().mainAsset as GameObject;
            if (null != gameObject)
            {
                this.m_goPlayAni = (UnityEngine.Object.Instantiate(gameObject) as GameObject);
                if (this == null)
                {
                    UnityEngine.Object.DestroyImmediate(this.m_goPlayAni);
                    return;
                }
                Vector2 screenPos   = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
                Vector3 effectUIPos = base.GetEffectUIPos(screenPos);
                effectUIPos.z = 300f;
                this.m_goPlayAni.transform.position = effectUIPos;
                NkUtil.SetAllChildLayer(this.m_goPlayAni, GUICamera.UILayer);
                this.m_goAnimation   = NkUtil.GetChild(this.m_goPlayAni.transform, "fx_dungeon").gameObject;
                this.m_goBackTexture = NkUtil.GetChild(this.m_goPlayAni.transform, "fx_plan_background").gameObject;
                if (this.m_goBackTexture != null && !string.IsNullOrEmpty(this.m_szBackImage))
                {
                    Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.m_szBackImage);

                    if (texture == null)
                    {
                        NrTSingleton <UIImageBundleManager> .Instance.RequestBundleImage(this.m_szBackImage, new PostProcPerItem(this.SetBundleImage));
                    }
                    else
                    {
                        Renderer component = this.m_goBackTexture.GetComponent <Renderer>();
                        if (component != null)
                        {
                            component.material.mainTexture = texture;
                        }
                    }
                }
                this.m_goPlayAni.SetActive(false);
                if (TsPlatform.IsMobile && TsPlatform.IsEditor)
                {
                    NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this.m_goPlayAni);
                }
            }
        }
    }
Ejemplo n.º 26
0
 public override void Update()
 {
     if (this.bUpdate)
     {
         if (this.m_SolComposeMainType != SOLCOMPOSE_TYPE.EXTRACT)
         {
             if (!this.bSetBaseFace && null != this.rootGameObject)
             {
                 this.strObjectKey       = "fx_face_base";
                 this.BasefaceGameObject = NkUtil.GetChild(this.rootGameObject.transform, this.strObjectKey).gameObject;
                 if (null != this.BasefaceGameObject)
                 {
                     this.bSetBaseFace = this.SetMaterial(ref this.BasefaceGameObject, this.BaseSolImageKey);
                 }
                 else
                 {
                     TsLog.LogError("BaseSolImageKey = {0}  BasefaceGameObject == NULL", new object[]
                     {
                         this.BaseSolImageKey
                     });
                 }
             }
             if (0f < this.startTime && Time.realtimeSinceStartup - this.startTime > 1.05f)
             {
                 this.bgImage.Visible = false;
                 this.startTime       = 0f;
             }
         }
         if (null != this.aniGameObject && !this.aniGameObject.isPlaying)
         {
             if (this.m_SolComposeMainType == SOLCOMPOSE_TYPE.EXTRACT)
             {
                 if (!this.bPlayExtractResult)
                 {
                     this.PlayExtractResult();
                     this.bPlayExtractResult = true;
                 }
                 else if (0f < this.startTime && Time.realtimeSinceStartup - this.startTime > 10.6f)
                 {
                     this.bUpdate = false;
                     this.SetExtractResultData();
                 }
             }
             else
             {
                 this.Close();
             }
         }
     }
 }
Ejemplo n.º 27
0
 private void LoadCompleteRankTexture(WWWItem _item, object _param)
 {
     if (_item != null && _item.canAccessAssetBundle)
     {
         Texture2D texture2D = _item.mainAsset as Texture2D;
         if (texture2D != null)
         {
             GameObject gameObject = NkUtil.GetChild(this.m_goRankEffectObject.transform, "fx_victory01").gameObject;
             if (gameObject != null)
             {
                 gameObject.renderer.sharedMaterial.mainTexture = texture2D;
             }
         }
     }
 }
Ejemplo n.º 28
0
 public static void SetFindChildActive(GameObject parent, string strFindName, bool _isActive)
 {
     if (null != parent)
     {
         Transform child = NkUtil.GetChild(parent.transform, strFindName);
         if (child != null)
         {
             NkUtil.SetAllChildActive(child.gameObject, _isActive);
         }
     }
     else
     {
         Debug.LogWarning("KKIComment2011/6/2/ : SetFindChildActive:if( null != parent)");
     }
 }
Ejemplo n.º 29
0
    public void CloseBattle()
    {
        GameObject gameObject = TsSceneSwitcher.Instance._GetSwitchData_RootSceneGO(TsSceneSwitcher.ESceneType.SoldierBatchScene);

        if (gameObject == null)
        {
            return;
        }
        Transform child = NkUtil.GetChild(gameObject.transform, "Main Camera");

        if (child == null)
        {
            return;
        }
        UnityEngine.Object.Destroy(this.m_TargetGo);
    }
Ejemplo n.º 30
0
 private void SetRewardButton(bool bShow)
 {
     this.m_LbelItemGet.Hide(bShow);
     this.m_BtnGetItem.SetEnabled(bShow);
     this.m_DT_ItemBg.Hide(!bShow);
     this.m_DT_ItemIcon.Hide(!bShow);
     this.m_Label_Item.Hide(!bShow);
     if (!bShow)
     {
         Transform child = NkUtil.GetChild(this.m_DT_ItemIcon.transform, "child_effect");
         if (child != null)
         {
             UnityEngine.Object.Destroy(child.gameObject);
         }
     }
 }