void Awake() { playerBallrb = playerBall.GetComponent <Rigidbody>(); playerController = playerBall.GetComponent <PlayerController>(); gameManager = FindObjectOfType <GameManager>(); colourSetter = GetComponentInParent <ColourSetter>(); }
void Awake() { canvas = GetComponentInChildren <Canvas>(); text = canvas.GetComponentInChildren <Text>(); outline = text.GetComponent <Outline>(); playerController = transform.parent.GetComponentInChildren <PlayerController>(); colourSetter = GetComponent <ColourSetter>(); }
// Use this for initialization void Start() { _colerer = GetComponent <ColourSetter>(); _reload = Random.value * RandomStartTime + MinStartTime; Emitter = Emitter != null ? Emitter : transform; _targetChoosingMechanism = GetComponent <IKnowsCurrentTarget>(); _enemyTagKnower = GetComponent <IKnowsEnemyTags>(); _spawner = GetComponent <Rigidbody>(); }
void colourmenu_Selected(object sender, Toolbox.ColourMenu.SelectionEventArgs args) { var colour_menu = (Toolbox.ColourMenu)sender; if (this.Equals(colour_menu.GetAncestor <TextDocument>())) { font_wimp_colour = args.Colour; ColourSetBy = ColourSetter.Menu; ForceRedraw(Extent); } }
void colourdbox_Selected(object sender, Toolbox.ColourDialogue.ColourSelectedEventArgs args) { var colour_dbox = (Toolbox.ColourDialogue)sender; // The colour dialogue is a shared toolbox object, so check that this is the // intended target of the event. if (this.Equals(colour_dbox.GetAncestor <TextDocument>())) { // We use the colour regardless of whether 'None' was selected. font_palette_colour = Toolbox.ColourDialogue. ColourFromColourBlock(args.ColourBlock); ColourSetBy = ColourSetter.Dialogue; ForceRedraw(Extent); } }
// Use this for initialization void Start() { _colerer = GetComponent <ColourSetter>(); _targetChoosingMechanism = GetComponent <IKnowsCurrentTarget>(); _enemyTagKnower = GetComponent <IKnowsEnemyTags>(); var emitterCount = EmitterParent.childCount; _emitters = new List <Transform>(); for (int i = 0; i < emitterCount; i++) { _emitters.Add(EmitterParent.GetChild(i)); } _reload = LoadTime; _fireControl = GetComponent <IFireControl>(); }
void Update() { // No one is in the zone if (zoneControl.playersInZone.Count == 0) { // Play the particles primaryParticle.Play(); secondaryParticle.Play(); splashParticle.Play(); // Set default colour primaryRenderer.sharedMaterial.SetColor("_TintColor", defaultColour); secondaryRenderer.sharedMaterial.SetColor("_TintColor", defaultColour); splashRenderer.sharedMaterial.SetColor("_EmissionColor", defaultColour); } // One person is in the zone else if (zoneControl.playersInZone.Count == 1) { // Play the particles primaryParticle.Play(); secondaryParticle.Play(); splashParticle.Play(); // Set colour to the only player in the zones colour ColourSetter playerColorSetter = zoneControl.playersInZone[0].transform.parent.GetComponentInChildren <ColourSetter>(); primaryRenderer.sharedMaterial.SetColor("_TintColor", playerColorSetter.primaryColour); secondaryRenderer.sharedMaterial.SetColor("_TintColor", playerColorSetter.secondaryColour); splashRenderer.sharedMaterial.SetColor("_EmissionColor", playerColorSetter.primaryColour); } else { // Set default colour primaryRenderer.sharedMaterial.SetColor("_TintColor", defaultColour); secondaryRenderer.sharedMaterial.SetColor("_TintColor", defaultColour); splashRenderer.sharedMaterial.SetColor("_EmissionColor", defaultColour); // Pause the animation primaryParticle.Pause(); secondaryParticle.Pause(); splashParticle.Pause(); } }
void Awake() { colourSetter = GetComponent <ColourSetter>(); csManager = GameObject.FindGameObjectWithTag("MenuManager").GetComponent <CSManager>(); }