void Start() { /* * rigidBody = GetComponent<Rigidbody>(); * startPosition = transform.position; * audioSource = GetComponent<AudioSource>(); * particle = GetComponent<ParticleSystem>(); * animation = GetComponent<Animation>(); */ if (TryGetComponent <Rigidbody>(out var rigidbodyTemp)) { rigidBody = rigidbodyTemp; } if (TryGetComponent <AudioSource>(out var audioSourceTemp)) { audioSource = audioSourceTemp; } if (TryGetComponent <ParticleSystem>(out var particleSystemTemp)) { particle = particleSystemTemp; } if (TryGetComponent <Animation>(out var animationTemp)) { animation = animationTemp; } startPosition = transform.position; playerContactParticle = FindObjectOfType <PlayerParticle>(); }
void OnSpawn() { PlayerParticle spawnFX = GameObject.Instantiate(gameManager.SpawnFXPrefab).GetComponent <PlayerParticle>(); spawnFX.transform.position = playerModel.transform.position; spawnFX.SetColor(TeamManager.Instance.GetTeamColor(teamID)); }
void OnDeath(Vector3 force) { PlayerParticle deathFX = GameObject.Instantiate(gameManager.DeathFXPrefab).GetComponent <PlayerParticle>(); deathFX.transform.position = playerModel.transform.position; deathFX.SetColor(TeamManager.Instance.GetTeamColor(teamID)); deathFX.SetVector(force); }
void Start() { BodyPhysic = gameObject.GetComponent <Rigidbody2D> (); Way = gameObject.GetComponent <Trajectory> (); CountManager = Count.GetComponent <Counters> (); Particle = GetComponent <PlayerParticle> (); Jumper = GetComponent <PlayerJumper> (); StartCoroutine(Jumper.Play(Grounded, BodyPhysic)); }
protected bool onGround; //是否在地面 //初始化 public virtual void OnInit() { manager = GetComponent <PlayerStateManager>(); particle = GetComponent <PlayerParticle>(); animator = GetComponent <Animator>(); rigid = GetComponent <Rigidbody>(); cc = GetComponent <CharacterController>(); player = GetComponent <PlayerCharacter>(); camera = Camera.main.GetComponent <SphereCamera>(); }
void Start() { manager = GetComponent <PlayerStateManager>(); particle = GetComponent <PlayerParticle>(); //初始化属性值 hp = hpMax; sp = spMax; ep = 0; epPoint = 3; spGain = 20.0f; //初始状态为 Move 每秒获得耐力值 }
void PlayPlayerContactParticle(Player player, PlayerParticle playerParticle, ContactPoint contactPoint) { //Debug.Log("playPlayercontactparticle"); //PlayerParticle playerParticle = FindObjectOfType<PlayerParticle>(); if (playerParticle != null) { // _particle.transform.parent = null; //_particle.transform.parent = transform; playerParticle.transform.position = contactPoint.point; playerParticle.PlayParticle(); player.GetAnimation.Play(); } }
public void OnButtonClick() { ItemBar.NBT nowNBT = ItemBar.nowSelectNbt; if (nowNBT.nbtt == ItemBar.NBTType.Effect) { Effect.AddEffect(ItemBar.nowSelectNbt.effectNBT.et, ItemBar.nowSelectNbt.effectNBT.el); PlayerParticle.AddEffect(ItemBar.nowSelectNbt.effectNBT.color); ItemBar.nowSelectNbt = new ItemBar.NBT() { canUse = false }; } ItemBar.UseItem(); bt.enabled = false; btImage.enabled = false; btText.enabled = false; }