Ejemplo n.º 1
0
 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
         );
 }
Ejemplo n.º 2
0
    // 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;
    }
Ejemplo n.º 3
0
 void Start()
 {
     shrines.Add(this);
     player     = player ?? FindObjectOfType <InfluenceAbsorption>().gameObject;
     playerAura = player.GetComponent <InfluenceAbsorption>();
 }
Ejemplo n.º 4
0
 void Start()
 {
     target  = FindObjectOfType <InfluenceAbsorption>();
     ownBody = GetComponent <Rigidbody>();
 }