예제 #1
0
    public override void Start()
    {
        base.Start();

        spin = Random.onUnitSphere * spinSpeed;

        Quaternion launcherRotation = Quaternion.FromToRotation(Vector3.up, worldVelocity.normalized);
        GameObject temp             = (GameObject)GameObject.Instantiate(launcherPrefab, transform.position, launcherRotation);

        temp.transform.Find("Quad").GetComponent <Renderer>().material.SetColor("_TintColor", weaponInst.GetLowAlphaColor());
        foreach (ParticleSystem p in temp.GetComponentsInChildren <ParticleSystem>())
        {
            ParticleSystem.MainModule pMain = p.main;
            pMain.startColor = weaponInst.GetLowAlphaColor();
        }
        this.GetComponent <TrailRenderer>().material.SetColor("_TintColor", weaponInst.GetLowAlphaColor());
        Destroy(temp, 1);

        this.GetComponent <MeshFilter>().mesh = ((Weapon)(weaponInst.GetItem())).bulletMesh;
        colorRenderer = this.GetComponent <Renderer>();
        colorRenderer.material.SetColor("_RimColor", ApplyAlphaReduction(weaponInst.GetQualityColor()));
        colorRenderer.material.SetColor("_InteriorColor", ApplyAlphaReduction(weaponInst.GetLowAlphaColor()));
    }