| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Spine.Unity;
- public class Trans_Invisible : MonoBehaviour
- {
- public Demonic demonic;
- [HideInInspector]
- public PlayerController player;
- //public float changeTime;
- public bool canInvincible;
- public float maxFlyHeight;
- public GameObject invisibleEffect;
- //public float addMp;
- //public InvisibleSoulCollector soulCollector;
- //public GameObject soulPrefab;
- //public float distance;
- //public Transform body;
- //public Transform shootPos;
- //public SoulFollowEffect soulFollowEffect;
- //public GameObject smokeEffect;
- //public float interval;
- //[HideInInspector]
- //public Vector3 lastSmokePos;
- //[HideInInspector]
- //public float time;
- //[HideInInspector]
- //public float normalSpeed;
- //public float KMp;
- //public float magnification;
- //public float firstScale;
- //public float addScaleMagnification;
- //public float boomTime;
- //public float addBoomTime;
- //public float maxBoomTime;
- //public float soulMagnification;
- private void Start()
- {
-
- player = transform.GetComponentInParent<PlayerController>();
- player.canfly = true;
- player.maxFlyHeight = maxFlyHeight;
- //playerController.changeTime = changeTime;
- //playerController.uiHp.gameObject.SetActive(false);
- //playerController.isInvisible = true;
- //playerController.mp += addMp;
- //if (playerController.floatState != 0)
- //{
- // playerController.floatState = 3;
- // player.transform.localEulerAngles = new Vector3(0, 0, 0);
- //}
- //normalSpeed = playerController.moveSpeed;
- //for (int i = 0;i < playerController.beTargetCharacter.Count; i++)
- //{
- // playerController.beTargetCharacter[i].targetCharacter = null;
- //}
- }
- private void Update()
- {
- if (player.isUltimate)
- {
- player.isUltimate = false;
- GameObject effect = Instantiate(invisibleEffect);
- effect.transform.position = transform.position;
-
- player.EndTransfiguration(6);
-
- }
- }
- /*
- private void Update()
- {
- if (playerController.isinputJ)
- {
- playerController.isinputJ = false;
- if (soulCollector.soulNumbers > soulFollowEffect.boomSoulNumber)
- {
- soulCollector.soulNumbers--;
- soulFollowEffect.ShowSouls(soulCollector.soulNumbers);
- AttackJ();
- }
- else if(playerController.mp>= soulPrefab.GetComponent<Soul>().addMp* soulMagnification)
- {
- playerController.mp -= soulPrefab.GetComponent<Soul>().addMp * soulMagnification;
- AttackJ();
- }
-
- }
- if (playerController.isClickBtnEast)
- {
- time = 0;
- playerController.moveSpeed = normalSpeed * magnification;
- }
- if (playerController.isinputK)
- {
- time += Time.deltaTime;
- if (time > interval)
- {
- AttackK();
- }
- }
- else
- {
- playerController.moveSpeed = normalSpeed;
- }
- if (playerController.isinputL)
- {
- playerController.isinputL = false ;
- if ((!soulFollowEffect.isBoom || soulFollowEffect.KBoomSoulTime > 0 )
- &&soulCollector.soulNumbers > 0
- && soulCollector.soulNumbers>soulFollowEffect.boomSoulNumber)
- {
- AttackL();
- }
-
- }
- if (!playerController.isTransfiguration)
- {
- BackToPlayer();
- }
- }
- private void OnDisable()
- {
- BackToPlayer();
- }
- public void BackToPlayer()
- {
- playerController.ani.Play("fall",0,0);
- playerController.mp += soulCollector.soulNumbers * soulPrefab.GetComponent<Soul>().addMp;
- soulCollector.soulNumbers = 0;
- }
- void AttackJ()
- {
- GameObject soulObj = Instantiate(soulPrefab);
- Soul soul = soulObj.GetComponent<Soul>();
- soul.from = shootPos.transform.position;
- if (playerController.rb.velocity == Vector3.zero)
- {
- if (body.localScale.x > 0)
- {
- soul.to = transform.position + Vector3.left * distance;
- }
- else
- {
- soul.to = transform.position + Vector3.right * distance;
- }
- }
- else
- {
- soul.to = transform.position + playerController.rb.velocity.normalized * distance;
- }
- soul.isShoot = true;
- }
- void AttackK()
- {
- if(playerController.mp >= KMp)
- {
- playerController.mp -= KMp;
- GameObject smoke = Instantiate(smokeEffect);
- smoke.transform.position = transform.position;
- lastSmokePos = transform.position;
- time = 0;
- }
- }
- void AttackL()
- {
- if(soulFollowEffect.boomSoulNumber == 0)
- {
- soulFollowEffect.KBoomSoulTime = boomTime;
- }
- else
- {
- soulFollowEffect.KBoomSoulTime += addBoomTime;
- if(soulFollowEffect.KBoomSoulTime > maxBoomTime)
- {
- soulFollowEffect.KBoomSoulTime = maxBoomTime;
- }
- }
- soulFollowEffect.boomSoulNumber++;
- soulFollowEffect.boomScale =
- firstScale * Mathf.Pow(soulFollowEffect.boomSoulNumber, addScaleMagnification);
- soulFollowEffect.SoulChangeColor(soulFollowEffect.boomSoulNumber - 1,true);
- soulFollowEffect.isBooming = true;
- }
- */
- }
|