Exemplo n.º 1
0
 private void Start()
 {
     durability  = maxDurability;
     sR          = GetComponent <SpriteRenderer>();
     cS          = GameObject.Find("CameraShake").GetComponent <CameraShake>();
     blinkEffect = GetComponent <BlinkEffect>();
 }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Awake()
 {
     SharedComponent = this;
     bossBodyBlinker =
         transform.Find("Boss Body").GetComponent <BlinkEffect>();
     audioSource = gameObject.AddComponent <AudioSource>();
 }
Exemplo n.º 3
0
 private void Awake()
 {
     if (shareComponent)
     {
         SharedComponent = this;
     }
 }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        blinkEffect = mainCamera.GetComponent <BlinkEffect>();
        showRecticleDot();

        // Movie Player is weird and needs a late start !!!!
        StartCoroutine(LateStart(0.5f));
    }
Exemplo n.º 5
0
 private IEnumerator WaitBlinkingAction(BlinkEffect blink)
 {
     while (blink.Is_Blinking)
     {
         yield return(new WaitForEndOfFrame());
     }
     Debug.Log("done blinking");
     FinishBlinking();
 }
Exemplo n.º 6
0
    // 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> ();
 }
Exemplo n.º 8
0
    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;
    }
Exemplo n.º 9
0
    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);
    }
Exemplo n.º 10
0
 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>();
 }
Exemplo n.º 11
0
    // 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);
    }
Exemplo n.º 12
0
    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);
    }
Exemplo n.º 13
0
        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;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 14
0
 private void Start()
 {
     m_blinkEffect = GetComponent <BlinkEffect>();
 }
Exemplo n.º 15
0
    //[SerializeField]
    //private MeshRenderer characterRenderer;


    // Start is called before the first frame update

    void Awake()
    {
        playerMovement = GetComponent <PlayerMovement>();
        shaderScript   = GetComponentInChildren <BlinkEffect>();
    }
Exemplo n.º 16
0
 private void Start()
 {
     Blink               = GetComponent <BlinkEffect>();
     Blink.Rate          = blinkRate;
     Blink.MaxBlinkCount = maxBlinkCount;
 }