blob: d5e9fe80ae4662310c427611a726b49b1372dcc3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
using UnityEngine;
public class SetTeamColorSpecific : MonoBehaviour
{
public Color[] colors;
private void Start()
{
Player player = GetComponentInParent<Player>();
if (!player)
{
player = GetComponentInParent<SpawnedAttack>().spawner;
}
ParticleSystem component = GetComponent<ParticleSystem>();
if ((bool)component)
{
_ = component.main;
component.startColor = colors[player.playerID];
}
LineRenderer component2 = GetComponent<LineRenderer>();
if ((bool)component2)
{
component2.startColor = colors[player.playerID];
component2.endColor = colors[player.playerID];
}
}
}
|