private void Start() { durability = maxDurability; sR = GetComponent <SpriteRenderer>(); cS = GameObject.Find("CameraShake").GetComponent <CameraShake>(); blinkEffect = GetComponent <BlinkEffect>(); }
// Start is called before the first frame update void Awake() { SharedComponent = this; bossBodyBlinker = transform.Find("Boss Body").GetComponent <BlinkEffect>(); audioSource = gameObject.AddComponent <AudioSource>(); }
private void Awake() { if (shareComponent) { SharedComponent = this; } }
// Use this for initialization void Start() { blinkEffect = mainCamera.GetComponent <BlinkEffect>(); showRecticleDot(); // Movie Player is weird and needs a late start !!!! StartCoroutine(LateStart(0.5f)); }
private IEnumerator WaitBlinkingAction(BlinkEffect blink) { while (blink.Is_Blinking) { yield return(new WaitForEndOfFrame()); } Debug.Log("done blinking"); FinishBlinking(); }
// Start is called before the first frame update void Awake() { initialHealth = health; //reactToDeath = gameObject.GetComponent<IReactToDeath>(); if (addDefaultBlink) { blinker = transform.GetChild(0).GetComponent <BlinkEffect>(); } audioSource = gameObject.AddComponent <AudioSource>(); }
private void OnEnable() { m_VRInput.OnSwipe += HandSwipe; EventController.Instance.Subscribe <ModeUpdatedEvent>(OnModeUpdatedEvent); EventController.Instance.Subscribe <EnableMSicknessEffectEvent>(OnEnableMSicknessEffectEvent); EventController.Instance.Subscribe <PlayBlinkEffectEvent>(OnPlayBlinkEffectEvent); EventController.Instance.Subscribe <SwitchBodiesEvent>(OnSwitchBodiesEvent); EventController.Instance.Subscribe <LaunchPTrailEvent>(OnLaunchPTrailEvent); mSicknessEffect = mainCamera.GetComponent <MotionSicknessEffect> (); blinkEffect = mainCamera.GetComponent <BlinkEffect> (); pTrailLauncher = mainCamera.GetComponent <PossesionTrailLauncher> (); }
void Awake() { // Setting up references. playerControl = GetComponent <PlayerControl>(); blink = GetComponent <BlinkEffect>(); healthBar = GameObject.Find("HealthBar").GetComponent <SpriteRenderer>(); GameObject spriteHolder = gameObject.transform.Find("body").gameObject; spriteRenderer = spriteHolder.GetComponent <SpriteRenderer>(); // Getting the intial scale of the healthbar (whilst the player has full health). healthScale = healthBar.transform.localScale; }
void Start() { audioPlayer = GetComponent <AudioSource>(); bgMusicPlayer = anna.GetComponent <AudioSource>(); blinkEffect = GetComponent <BlinkEffect>(); animation = GetComponent <Animation>(); levelManager = FindObjectOfType <LevelManager>(); blinkEffect.SetDefaultFadeInAnimationCurves(0.8f); blinkEffect.SetDefaultFadeOutAnimationCurves(0.8f); blinkEffect.Blink(); Invoke("WakeUp", 3f); }
public BossHealthData( //string locationName, Functional.Action onLocationHealthZero, //Functional.Action<Damage, string> onDamageSubPart, GameObject parts, float health ) { this.onLocationHealthZero = onLocationHealthZero; //this.onDamageSubPart = onDamageSubPart; this.parts = parts; this.health = health; blinker = parts.GetComponent <BlinkEffect>(); }
// Use this for initialization void Start() { //Refresh rate speed = 0.3f; dispDown = down.GetComponent <Text>().GetComponent <DispKey>(); dispUp = up.GetComponent <Text>().GetComponent <DispKey>(); dispRight = right.GetComponent <Text>().GetComponent <DispKey>(); dispLeft = left.GetComponent <Text>().GetComponent <DispKey>(); score = ScoreDisp.GetComponent <Text>().GetComponent <DispKey>(); rightKey = RandControl(rightKey); downKey = RandControl(downKey); leftKey = RandControl(leftKey); upKey = RandControl(upKey); if (rightKey == leftKey || rightKey == downKey || rightKey == upKey) { rightKey = RandControl(rightKey); } if (downKey == rightKey || downKey == leftKey || downKey == upKey) { downKey = RandControl(downKey); } if (leftKey == rightKey || leftKey == downKey || leftKey == upKey) { leftKey = RandControl(leftKey); } if (upKey == rightKey || upKey == downKey || upKey == leftKey) { upKey = RandControl(upKey); } dispRight.NewKey(rightKey); dispLeft.NewKey(leftKey); dispDown.NewKey(downKey); dispUp.NewKey(upKey); blinkUp = up.GetComponentInChildren <BlinkEffect>(); blinkRight = right.GetComponentInChildren <BlinkEffect>(); blinkLeft = left.GetComponentInChildren <BlinkEffect>(); blinkDown = down.GetComponentInChildren <BlinkEffect>(); blinkSnake = GetComponent <BlinkEffect>(); InvokeRepeating("Move", speed, speed); }
void Start() { Time.timeScale = 1f; gergoText = gergo.GetComponent <Text>(); cranfieldText = cranfield.GetComponent <Text>(); efmText = efm.GetComponent <Text>(); blinkEffect = FindObjectOfType <Camera>().GetComponent <BlinkEffect>(); cameraAnimator = FindObjectOfType <Camera>().GetComponent <Animator>(); levelManager = FindObjectOfType <LevelManager>(); AudioSource[] audioSources = GetComponents <AudioSource>(); heartbeatPlayer = audioSources[0]; heartbeatPlayer.loop = true; heartbeatPlayer.clip = heartbeatSound; breathPlayer = audioSources[1]; breathPlayer.clip = breathSound; heartbeatPlayer.Play(); Invoke("PlayCranfieldAnimation", 2.5f); }
private void SetupTable(Table.Table Table, Dictionary <int, TableConfig> TableConfigDict, Dictionary <int, Dictionary <int, IToy> > ToyAssignments) { foreach (KeyValuePair <int, TableConfig> KV in TableConfigDict) { int LedWizNr = KV.Key; if (ToyAssignments.ContainsKey(LedWizNr)) { TableConfig TC = KV.Value; foreach (TableConfigColumn TCC in TC.Columns) { if (ToyAssignments[LedWizNr].ContainsKey(TCC.Number)) { IToy Toy = ToyAssignments[LedWizNr][TCC.Number]; int SettingNumber = 0; foreach (TableConfigSetting TCS in TCC) { SettingNumber++; IEffect Effect = null; int Layer = (TCS.Layer.HasValue ? TCS.Layer.Value : SettingNumber); if (Toy is IRGBAToy || Toy is IAnalogAlphaToy) { if (Toy is IRGBAToy) { RGBAColor ActiveColor = null; if (TCS.ColorConfig != null) { ActiveColor = TCS.ColorConfig.GetCabinetColor().GetRGBAColor(); } else { if (!TCS.ColorName.IsNullOrWhiteSpace()) { if (TCS.ColorName.StartsWith("#")) { ActiveColor = new RGBAColor(); if (!ActiveColor.SetColor(TCS.ColorName)) { ActiveColor = null; Log.Warning("Skipped setting {0} in column {1} for LedWizEqivalent number {2} since {3} is not a valid color specification.".Build(new object[] { SettingNumber, TCC.Number, LedWizNr, TCS.ColorName })); } } else { Log.Warning("Skipped setting {0} in column {1} for LedWizEqivalent number {2} since {3} is not a valid color specification.".Build(new object[] { SettingNumber, TCC.Number, LedWizNr, TCS.ColorName })); } } else { Log.Warning("Skipped setting {0} in column {1} for LedWizEqivalent number {2} since it does not contain a color specification.".Build(SettingNumber, TCC.Number, LedWizNr)); } } if (ActiveColor != null) { if (TCS.FadingDownDurationMs > 0 || TCS.FadingUpDurationMs > 0) { //Must fade, use fadeeffect Effect = new RGBAFadeOnOffEffect() { ToyName = Toy.Name, Layer = Layer, FadeActiveDurationMs = TCS.FadingUpDurationMs, FadeInactiveDurationMs = TCS.FadingDownDurationMs, RetriggerBehaviour = RetriggerBehaviourEnum.IgnoreRetrigger, FadeMode = FadeModeEnum.CurrentToDefined, ActiveColor = ActiveColor, InactiveColor = new RGBAColor(0, 0, 0, 0) }; } else { //No fadinging, set color directly Effect = new RGBAOnOffEffect() { ToyName = Toy.Name, Layer = Layer, ActiveColor = ActiveColor, InactiveColor = new RGBAColor(0, 0, 0, 0) }; } } } else if (Toy is IAnalogAlphaToy) { AnalogAlphaValue AAV = new AnalogAlphaValue(((int)((double)TCS.Intensity * 5.3125)).Limit(0, 255)); if (TCS.FadingDownDurationMs > 0 || TCS.FadingUpDurationMs > 0) { Effect = new AnalogToyFadeOnOffEffect() { ToyName = Toy.Name, Layer = Layer, FadeActiveDurationMs = TCS.FadingUpDurationMs, FadeInactiveDurationMs = TCS.FadingDownDurationMs, RetriggerBehaviour = RetriggerBehaviourEnum.IgnoreRetrigger, FadeMode = FadeModeEnum.CurrentToDefined, ActiveValue = AAV, InactiveValue = new AnalogAlphaValue(0, 0) }; } else { Effect = new AnalogToyOnOffEffect() { ToyName = Toy.Name, Layer = Layer, ActiveValue = AAV, InactiveValue = new AnalogAlphaValue(0, 0) }; } } if (Effect != null) { Effect.Name = "Ledwiz {0:00} Column {1:00} Setting {2:00} {3}".Build(new object[] { LedWizNr, TCC.Number, SettingNumber, Effect.GetType().Name }); MakeEffectNameUnique(Effect, Table); Table.Effects.Add(Effect); if (TCS.Blink != 0) { Effect = new BlinkEffect() { Name = "Ledwiz {0:00} Column {1:00} Setting {2:00} BlinkEffect".Build(LedWizNr, TCC.Number, SettingNumber), TargetEffectName = Effect.Name, DurationActiveMs = TCS.BlinkIntervalMs, DurationInactiveMs = TCS.BlinkIntervalMs }; MakeEffectNameUnique(Effect, Table); Table.Effects.Add(Effect); } if (TCS.DurationMs > 0 || TCS.Blink > 0) { int Duration = (TCS.DurationMs > 0 ? TCS.DurationMs : (TCS.Blink * 2 - 1) * TCS.BlinkIntervalMs + 1); Effect = new DurationEffect() { Name = "Ledwiz {0:00} Column {1:00} Setting {2:00} DurationEffect".Build(LedWizNr, TCC.Number, SettingNumber), TargetEffectName = Effect.Name, DurationMs = Duration, RetriggerBehaviour = RetriggerBehaviourEnum.RestartEffect }; MakeEffectNameUnique(Effect, Table); Table.Effects.Add(Effect); } if (TCS.MinDurationMs > 0 || (Toy is IRGBAToy && EffectRGBMinDurationMs > 0) || (!(Toy is IRGBAToy) && EffectMinDurationMs > 0)) { string N = (TCS.MinDurationMs > 0 ? "MinDuratonEffect" : "DefaultMinDurationEffect"); int Min = (TCS.MinDurationMs > 0 ? TCS.MinDurationMs : (Toy is IRGBAToy ? EffectRGBMinDurationMs : EffectMinDurationMs)); Effect = new MinDurationEffect() { Name = "Ledwiz {0:00} Column {1:00} Setting {2:00} {3}".Build(new object[] { LedWizNr, TCC.Number, SettingNumber, N }), TargetEffectName = Effect.Name, MinDurationMs = Min }; MakeEffectNameUnique(Effect, Table); Table.Effects.Add(Effect); } if (TCS.WaitDurationMs > 0) { Effect = new DelayEffect() { Name = "Ledwiz {0:00} Column {1:00} Setting {2:00} DelayEffect".Build(LedWizNr, TCC.Number, SettingNumber), TargetEffectName = Effect.Name, DelayMs = TCS.WaitDurationMs }; MakeEffectNameUnique(Effect, Table); Table.Effects.Add(Effect); } switch (TCS.OutputControl) { case OutputControlEnum.FixedOn: Table.AssignedStaticEffects.Add(new AssignedEffect(Effect.Name)); break; case OutputControlEnum.Controlled: if (!Table.TableElements.Contains(TCS.TableElementType, TCS.TableElementNumber)) { Table.TableElements.UpdateState(TCS.TableElementType, TCS.TableElementNumber, 0); } Table.TableElements[TCS.TableElementType, TCS.TableElementNumber].AssignedEffects.Add(new AssignedEffect(Effect.Name)); break; case OutputControlEnum.FixedOff: default: break; } } } } } } } } }
private void Start() { m_blinkEffect = GetComponent <BlinkEffect>(); }
//[SerializeField] //private MeshRenderer characterRenderer; // Start is called before the first frame update void Awake() { playerMovement = GetComponent <PlayerMovement>(); shaderScript = GetComponentInChildren <BlinkEffect>(); }
private void Start() { Blink = GetComponent <BlinkEffect>(); Blink.Rate = blinkRate; Blink.MaxBlinkCount = maxBlinkCount; }