Beispiel #1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.P))
        {
            Debug.Log("KEYDOWN");
            GameObject go = new GameObject();
            go.transform.position = Player.Instance.transform.position;
            AddEffect(ScalingRing.CreateComponent(go, 1.0f, true, 0.0f, 1.0f));
            //this.BlitAtPosition(GroundShadingManager.WorldToUVSpace(go.transform.position), 1.0f, false);
        }

        //update effects
        foreach (var effect in m_Effects)
        {
            if (effect == null)
            {
                continue;
            }
            effect.UpdateEffect(Time.deltaTime);
        }

        //foreach (var ctrl in m_GroundShaders)
        //{
        //    //blit player
        //    ctrl.BlitGraphicToUVPosition(m_RadialGraphic, playerPos, Mathf.Max(Player.Instance.VelocityNormalised + 0.5f, 0.75f), !Input.GetKey(KeyCode.Space));
        //    //ctrl.BlitAtPosition(playerPos, 0.25f, false);

        //    //blit effects
        //}
    }
Beispiel #2
0
    void OnTriggerEnter(Collider col)
    {
        var go = new GameObject();

        go.transform.position = this.transform.position;
        GroundShadingManager.AddEffect(ScalingRing.CreateComponent(go, 0.5f, false, 0.1f, 3.0f));
        go = new GameObject();
        go.transform.position = this.transform.position;
        GroundShadingManager.AddEffect(ScalingRing.CreateComponent(go, 0.5f, true, 0.1f, 3.2f));
    }
Beispiel #3
0
    public static ScalingRing CreateComponent(GameObject where, float life, bool fade, float startScale, float endScale)
    {
        ScalingRing myC = where.AddComponent <ScalingRing>();

        myC.m_LifeTime   = life;
        myC.b_Fade       = fade;
        myC.m_StartScale = startScale;
        myC.m_EndScale   = endScale;

        return(myC);
    }