bool CanActivate(InfluenceAbsorption character) { return( Mathf.Abs(aura.x - character.Accumulation.x) < tolerance && Mathf.Abs(aura.y - character.Accumulation.y) < tolerance && Mathf.Abs(aura.z - character.Accumulation.z) < tolerance ); }
// Start is called before the first frame update void Start() { system = GetComponent <ParticleSystem>(); player = FindObjectOfType <InfluenceAbsorption>(); var colourProportions = GetInfluenceProportions(); var colour = new Color(colourProportions.x, colourProportions.y, colourProportions.z); var renderer = GetComponent <Renderer>(); renderer.material.SetVector("_Influence", colour); var particleColours = system.colorOverLifetime; particleColours.enabled = true; var gradient = new Gradient(); gradient.SetKeys(new GradientColorKey[] { new GradientColorKey(colour, 0f), new GradientColorKey(colour, 1f) }, new GradientAlphaKey[] { new GradientAlphaKey(1f, 0.66f), new GradientAlphaKey(0f, 1f) }); particleColours.color = gradient; }
void Start() { shrines.Add(this); player = player ?? FindObjectOfType <InfluenceAbsorption>().gameObject; playerAura = player.GetComponent <InfluenceAbsorption>(); }
void Start() { target = FindObjectOfType <InfluenceAbsorption>(); ownBody = GetComponent <Rigidbody>(); }