| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Spine.Unity;
- public class Spirits_Invisible : MonoBehaviour
- {
- public Demonic demonic;
- [HideInInspector]
- public GameObject player;
- [HideInInspector]
- public PlayerController playerController;
- public float addMp;
- public InvisibleSoulCollector soulCollector;
- public GameObject soulPrefab;
- public float distance;
- public Transform body;
- public Transform shootPos;
- public SoulFollowEffect soulFollowEffect;
- private void Start()
- {
-
- player = PlayersInput.instance[demonic.playerID].gameObject;
- playerController = player.GetComponent<PlayerController>();
- playerController.isInvisible = true;
- playerController.mp += addMp;
- for(int i = 0;i < playerController.beTargetCharacter.Count; i++)
- {
- playerController.beTargetCharacter[i].targetCharacter = null;
- }
- }
- private void Update()
- {
- if (playerController.btnWestPress)
- {
- if (soulCollector.soulNumbers > 0)
- {
- soulCollector.soulNumbers--;
- soulFollowEffect.ShowSouls(soulCollector.soulNumbers);
- AttackJ();
- }
- else if(playerController.mp>=10)
- {
- playerController.mp -= 10;
- AttackJ();
- }
-
- }
- }
- public void BackToPlayer()
- {
- }
- void AttackJ()
- {
- GameObject soulObj = Instantiate(soulPrefab);
- Soul soul = soulObj.GetComponent<Soul>();
- soul.from = shootPos.transform.position;
- if(body.localScale.x > 0)
- {
- soul.to = transform.position + Vector3.left * distance;
- }
- else
- {
- soul.to = transform.position + Vector3.right * distance;
- }
- soul.isShoot = true;
- }
- }
|