Ejemplo n.º 1
0
 public void PlayAnimationTrigger(CharacterParams param)
 {
     this.StopAnimation();
     base.gameObject.SetActive(true);
     if (this._target == CharacterTarget.CharacterCenter)
     {
         this._PlayAnimation = base.PlayAnimation(param.characterCenterTarget, param.RootToCenterDistance());
     }
     else if (this._target == CharacterTarget.CharacterFaceCenter)
     {
         this._PlayAnimation = base.PlayAnimation(param.characterFaceCenterTarget, param.RootToCenterDistance());
     }
     else if (this._target == CharacterTarget.CharacterRoot)
     {
         this._PlayAnimation = base.PlayAnimation(param.transform, param.RootToCenterDistance());
     }
     else
     {
         this._PlayAnimation = base.PlayAnimation(null, param.RootToCenterDistance());
     }
     this.CharacterFollowingInitializeInternal(param);
     this.cachedCharacter = param;
     base.StartCoroutine(this._PlayAnimation);
     this._scale = this.cachedCharacter.effectScale;
     base.transform.localScale  = Vector3.one;
     base.transform.localScale *= this._scale;
     foreach (ParticleSystem particles in this._particleSystems)
     {
         ParticleScaler.Scale(particles, this._scale, true, null);
     }
 }
        private void cameraPositionAdjustment()
        {
            CharacterParams component = this.afterMonster.GetComponent <CharacterParams>();
            float           num       = component.RootToCenterDistance();

            num = num / 2f + 1.5f;
            this.lastCutCamera.localPosition = new Vector3(0f, 0f, num);
        }
Ejemplo n.º 3
0
    public IEnumerator PlayAnimationCorutine(CharacterParams characterParams)
    {
        if (this._effectAnimation == null)
        {
            yield break;
        }
        base.gameObject.SetActive(true);
        this.StopAnimationInternal();
        if (characterParams != null)
        {
            switch (this._target)
            {
            case CharacterTarget.CharacterCenter:
                this.SetPosition(characterParams.characterCenterTarget, null);
                break;

            case CharacterTarget.CharacterRoot:
                this.SetPosition(characterParams.transform, null);
                break;

            case CharacterTarget.CharacterFaceCenter:
                this.SetPosition(characterParams.characterFaceCenterTarget, null);
                break;

            case CharacterTarget.WorldRoot:
                this.SetPosition(null, null);
                break;
            }
        }
        this._isPlaying = true;
        this._effectAnimation.clip.wrapMode = WrapMode.Once;
        this._effectAnimation.PlayQueued(this._effectAnimation.clip.name, QueueMode.PlayNow);
        this.CharacterFollowingInitializeInternal(characterParams);
        this.BillboardObjectInitializeInternal(base.transform, characterParams.RootToCenterDistance());
        this.ParticheControllerInitializeInternal();
        while (this._effectAnimation.isPlaying)
        {
            yield return(null);
        }
        this.StopAnimationInternal();
        yield break;
    }
 private IEnumerator PlaySkillAnimationInternal(CharacterParams attacker)
 {
     if (attacker != null)
     {
         if (this._cameraMotionId.Length > 0)
         {
             this.SetPosition(attacker.transform, null);
         }
         else
         {
             this.SetPosition(attacker.transform, new Vector3?(attacker.dropItemOffsetPosition));
         }
     }
     this.StopAnimationInternal();
     this._isPlaying        = true;
     this.currentStageColor = Color.black;
     if (this._renderCamera != null)
     {
         this.currentStageColor = this._renderCamera.backgroundColor;
         if (this._hideStage)
         {
             if (this._lightColorChanger != null)
             {
                 this._lightColorChanger.isEnable    = false;
                 this.currentSunLightColor           = this._lightColorChanger.light.color;
                 this._lightColorChanger.light.color = this._hideStageLightColor;
                 this.currentSunLightRotation        = this._lightColorChanger.light.transform.rotation;
                 this._lightColorChanger.light.transform.rotation = Quaternion.Euler(this._hideStageLightEulerAngles);
             }
             if (this._stageObject != null)
             {
                 this._stageObject.SetActive(false);
             }
             this._renderCamera.backgroundColor = this._hideStageBackgroundColor;
         }
     }
     this._effectAnimation.clip.wrapMode = WrapMode.Once;
     this._effectAnimation[this._effectAnimation.clip.name].time = 0f;
     this._effectAnimation.PlayQueued(this._effectAnimation.clip.name, QueueMode.PlayNow);
     if (attacker != null && attacker.GetFindAttackMotion(this._motionIndex))
     {
         attacker.PlayAnimation(CharacterAnimationType.attacks, this._attackAnimationType, this._motionIndex, null, null);
         this.CharacterFollowingInitializeInternal(attacker);
         this.BillboardObjectInitializeInternal(attacker.transform, attacker.RootToCenterDistance());
         this.ParticheControllerInitializeInternal();
     }
     if (this._cameraMotionId.Length == 0)
     {
         this._scale = attacker.effectScale;
         base.transform.localScale  = Vector3.one;
         base.transform.localScale *= this._scale;
         foreach (ParticleSystem particles in this._particleSystems)
         {
             ParticleScaler.Scale(particles, this._scale, true, null);
         }
     }
     if (this._attackAnimationType == SkillType.InheritanceTechnique)
     {
         float motionTime = (!(attacker != null)) ? 0f : attacker.AnimationClipLength;
         float effectTime = this._effectAnimation[this._effectAnimation.clip.name].length;
         float time       = Mathf.Max(motionTime, effectTime);
         while (time > 0f)
         {
             time -= Time.deltaTime;
             if (!this._effectAnimation.isPlaying && this._effectAnimation.gameObject.activeInHierarchy)
             {
                 this._effectAnimation.gameObject.SetActive(false);
             }
             yield return(null);
         }
         this._effectAnimation.gameObject.SetActive(true);
     }
     else
     {
         while (this._effectAnimation.isPlaying)
         {
             yield return(null);
         }
     }
     yield break;
 }
Ejemplo n.º 5
0
 public void UpdateShadowPosition(CharacterParams character)
 {
     this.cachedTransform.position      = new Vector3(character.characterCenterTarget.position.x, character.characterCenterTarget.position.y + character.RootToCenterDistance(), character.characterCenterTarget.position.z);
     this.cachedTransform.localRotation = Quaternion.identity;
 }
Ejemplo n.º 6
0
    public static ShadowParams SetShadowObject(CharacterParams character)
    {
        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(ShadowParams.GetShadowParamPrefab());

        gameObject.name = "Shadow";
        gameObject.transform.SetParent(character.transform);
        gameObject.transform.position      = new Vector3(character.characterCenterTarget.position.x, character.characterCenterTarget.position.y + character.RootToCenterDistance(), character.characterCenterTarget.position.z);
        gameObject.transform.localRotation = Quaternion.identity;
        gameObject.transform.localScale    = Vector3.one;
        ShadowParams component = gameObject.GetComponent <ShadowParams>();

        foreach (Renderer renderer in character.transform.GetComponentsInChildren <Renderer>())
        {
            renderer.gameObject.layer = component.shadowLayerMask.value;
        }
        component.Initialize();
        return(component);
    }