// Use this for initialization void Start() { lightFixture = transform.parent; lightRenderer = lightFixture.GetComponentInChildren <SFLight>(); spriteRenderer = GetComponent <SpriteRenderer>(); if (lightRenderer.gameObject.activeSelf == true) { lightOn = true; } }
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); }
// 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; } }
// Use this for initialization void Start() { sflight = GetComponent <SFLight>(); pe = GetComponentInParent <PlayerEnergy>(); }
// Use this for initialization void Start() { sfLight = GetComponent <SFLight>(); }