private void Start() { BaddyLaser = Instantiate(BaddyLaserPrefab, gameObject.transform.position, Quaternion.identity); LaserSprite = BaddyLaser.GetComponentInChildren <SpriteRenderer>(); collidingPlayers = BaddyLaser.GetComponent <CollidingPlayers>(); collidingEnvironment = BaddyLaser.GetComponent <CollidingEnvironment>(); BaddyLaser.SetActive(false); Bmgr = gameObject.GetComponent <BaddyAttackManager>(); }
// Start is called before the first frame update void Start() { sharedLineMaterial = new Material(sourceMaterialToCopy); var renderers = linesContainer.GetComponentsInChildren <SpriteRenderer>(); foreach (Renderer rend in renderers) { rend.sharedMaterial = sharedLineMaterial; } collidingPlayers = linesContainer.GetComponent <CollidingPlayers>(); mgr = gameObject.GetComponent <CuboidAttackManager>(); }
// Start is called before the first frame update void Start() { linesContainer = Instantiate(linesContainerPrefab, transform.position, Quaternion.identity); linesContainer.SetActive(false); sharedLineMaterial = new Material(sourceMaterialToCopy); var renderers = linesContainer.GetComponentsInChildren <SpriteRenderer>(); foreach (Renderer rend in renderers) { rend.sharedMaterial = sharedLineMaterial; } collidingPlayers = linesContainer.GetComponent <CollidingPlayers>(); mgr = gameObject.GetComponent <CuboidAttackManager>(); }