コード例 #1
0
    // Use this for initialization
    void Start()
    {
        lightFixture   = transform.parent;
        lightRenderer  = lightFixture.GetComponentInChildren <SFLight>();
        spriteRenderer = GetComponent <SpriteRenderer>();

        if (lightRenderer.gameObject.activeSelf == true)
        {
            lightOn = true;
        }
    }
コード例 #2
0
    public void Fire()
    {
        GameObject     go = (GameObject)Instantiate(bulletPrefab, transform.position, Quaternion.identity);
        AsteroidBullet b  = go.GetComponent <AsteroidBullet>();

        b.vel = maxSpeed * 3.0f * (Vector2)transform.up;

        SFLight bulletLight = go.GetComponent <SFLight>();

        bulletLight.intensity = bulletIntensity;
        bulletLight.color     = Color.HSVToRGB(hue, 1f, 1f);
        b.sr.color            = bulletLight.color;

        hue = (hue + 0.15f) % 1.0f;

        Destroy(go, 5.0f);
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        cs      = GetComponentInParent <ControlStatus> ();
        lightsf = GetComponent <SFLight> ();

        if (cs)
        {
            cs.OnCutByEnemy  += TurnOffLight;
            cs.OnCutByPlayer += TurnOffLight;

            cs.OnLinkedByEnemy += SetBossColor;
            cs.OnLinkedByEnemy += TurnOnLight;

            cs.OnLinkedByPlayer += SetHackerColor;
            cs.OnLinkedByPlayer += TurnOnLight;
        }
    }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     sflight = GetComponent <SFLight>();
     pe      = GetComponentInParent <PlayerEnergy>();
 }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     sfLight = GetComponent <SFLight>();
 }