コード例 #1
0
ファイル: ShieldBubble.cs プロジェクト: smw3/SpacePew
    private void ShieldHit(Vector3 contactPoint, float intensity)
    {
        shieldHit sh = new shieldHit();

        sh.pos       = contactPoint;
        sh.time      = Time.timeSinceLevelLoad;
        sh.intensity = intensity;

        shieldHitArray.Add(sh);

        //EntityEffect LightEffect = (EntityEffect)Instantiate(OnHitEffect, contactPoint, Quaternion.identity);
        //LightEffect.GetComponent<EntityEffect_LightFade>().setIntensity(intensity);
    }
コード例 #2
0
ファイル: ShieldBubble.cs プロジェクト: smw3/SpacePew
    void OnRenderObject()
    {
        int points_length = shieldHitArray.Count;

        MR.material.SetInt("_Points_Length", points_length);
        for (int i = 0; i < points_length; i++)
        {
            shieldHit sh = shieldHitArray[i];
            MR.material.SetVector("_Points" + i.ToString(), sh.pos);

            Vector3 properties = new Vector3(sh.intensity * 5, sh.intensity, sh.time);
            MR.material.SetVector("_Properties" + i.ToString(), properties);
        }
    }