Beispiel #1
0
        //Views are pieces of pages that can be slid in and out.
        //Views are under development and not used in the HLD app
        //TODO: create View Handling

        #endregion

        //When a button is pressed, the app screen will slide in at a specified rate. Rate=1.0f will move instantly reveal the screen,
        //Other rates will allow the screen to slide in from the right.
        public IEnumerator MoveScreenIn(bool initializing = false)
        {
            //if (!(InternetRequired && !UIB_PageManager.InternetActive))
            ToggleCanvas(true);

            float lerp = 0;
            var   tmp  = rate;

            if (initializing)
            {
                tmp = 1;
            }

            // while (true && !(InternetRequired && !UIB_PageManager.InternetActive))
            while (true)
            {
                rt.anchoredPosition = new Vector2(0, 0);
                lerp += tmp;
                if (rt.anchoredPosition == new Vector2(0, 0))
                {
                    break;
                }

                yield return(null);
            }
            PageOnScreen = true;

            OnActivated?.Invoke(); //should always be last

            yield break;
        }
Beispiel #2
0
    public IEnumerator SkillRoutine(Vector3 origin)
    {
        yield return(new WaitForSeconds(0.5f));

        Sequence s = DOTween.Sequence();

        s.Append(actor.transform.DOMoveY(riseRange, riseDuration));

        yield return(new WaitForSeconds(riseDuration));

        Vector3 rotate = new Vector3(0, 180, 0);

        s.Append(actor.transform.DOBlendableRotateBy(rotate, spinTime));
        s.Append(actor.transform.DOBlendableRotateBy(rotate, spinTime));
        s.Append(actor.transform.DOBlendableRotateBy(rotate, spinTime));
        s.Append(actor.transform.DOBlendableRotateBy(rotate, spinTime).OnComplete(Effect));
        if (audioManager)
        {
            audioManager.PlaySFX("Cast_Ice_Shield");
        }

        yield return(new WaitForSeconds(spinDuration));

        s.Append(actor.transform.DOMove(origin, riseDuration));

        OnActivated.Invoke();

        base.SkillEffectEnd();
        actor.GetComponent <CustomCharacterController>().OnDestinationReach.Invoke();
    }
Beispiel #3
0
    public IEnumerator SkillRoutine(Vector3 baseScale)
    {
        Vector3 pos = actor.transform.position;

        yield return(new WaitForSeconds(0.5f));

        Sequence s     = DOTween.Sequence();
        Vector3  scale = new Vector3(scaleSize, scaleSize, scaleSize);

        s.Append(actor.transform.DOBlendableScaleBy(scale, duration));
        yield return(new WaitForSeconds(duration));

        GameObject effectInstance = Instantiate(particleEffect, pos + (Vector3.up * animYOffset), particleEffect.transform.rotation);

        //effectInstance.transform.SetParent(actor.transform);
        if (audioManager)
        {
            audioManager.PlaySFX("Cast_War_Cry");
        }
        yield return(new WaitForSeconds(2f));

        s.Append(actor.transform.DOScale(baseScale, duration));
        yield return(new WaitForSeconds(duration));

        OnActivated.Invoke();

        base.SkillEffectEnd();

        actor.GetComponent <CustomCharacterController>().OnDestinationReach.Invoke();
    }
Beispiel #4
0
    public IEnumerator SkillRoutine(CustomCharacterController cc, Vector3 origin)
    {
        yield return(new WaitForSeconds(0.5f));

        float facing = -90;
        //Rise Up
        Sequence s = DOTween.Sequence();

        s.Append(actor.transform.DOMoveY(riseRange, riseDuration));
        yield return(new WaitForSeconds(riseDuration));

        //Move To Enemy
        Bounds bound = new Bounds();

        foreach (var item in enemies)
        {
            bound.Encapsulate(item.transform.position);
        }

        Vector3 movePoint = bound.center;

        movePoint.y += movePointYOffset;
        s.Append(actor.transform.DOMove(movePoint, moveToDuration));
        yield return(new WaitForSeconds(moveToDuration));

        //Wind Up
        Vector3 rotate = new Vector3(windUp - actor.transform.rotation.x, facing, 0);

        s.Append(actor.transform.DORotate(rotate, windUpDuration));
        s.Append(actor.transform.DOPunchScale(new Vector3(2, 2, 2), windUpDuration, 5, 0.5f));
        yield return(new WaitForSeconds(windUpDuration));

        //Slam
        rotate = new Vector3(0, 180, 0);
        s.Append(actor.transform.DOBlendableRotateBy(rotate, heliSpeed));
        rotate = new Vector3(0, 180, 0);
        s.Append(actor.transform.DOBlendableRotateBy(rotate, heliSpeed));
        rotate = new Vector3(0, 180, 0);
        s.Append(actor.transform.DOBlendableRotateBy(rotate, heliSpeed));
        rotate = new Vector3(0, 180, 0);
        s.Append(actor.transform.DOBlendableRotateBy(rotate, heliSpeed));

        foreach (var item in enemies)
        {
            DealDamage(item, damage);
        }
        GameObject effectInstance = Instantiate(wideSlashEffect, actor.transform.position + (Vector3.up * animYOffset), wideSlashEffect.transform.rotation);

        OnActivated.Invoke();

        yield return(new WaitForSeconds(heliDuration));

        s.Append(actor.transform.DORotate(new Vector3(0, facing, 0), 0.1f));
        movePoint = origin;
        s.Append(actor.transform.DOMove(movePoint, returnDuration).OnComplete(SkillEffectEnd));
        yield return(new WaitForSeconds(returnDuration));

        cc.GetComponent <CustomCharacterController>().OnDestinationReach.Invoke();
    }
Beispiel #5
0
    public override void SkillEffect()
    {
        OnActivated.AddListener(RollForBuff);

        Vector3 origin = actor.transform.position;

        StartCoroutine(SkillRoutine(actor.GetComponent <CustomCharacterController>(), origin));
    }
 public static void OnActivatedInternal(string args, NotificationUserInput input, string aumid)
 {
     OnActivated?.Invoke(new NotificationActivatiedEventArgs()
     {
         Arguments = args,
         UserInput = input
     });
 }
Beispiel #7
0
    void UpdateInteraction()
    {
        if (!Active) return;

        if (Input.GetKeyDown(KeyCode.Space) || AutoInteract)
            if (OnActivated != null)
                OnActivated.Invoke();
    }
    // Trigger activation events
    public void TriggerActivated()
    {
        OnActivated?.Invoke(this, EventArgs.Empty);

        if (!IsActive)
        {
            IsActive = true;
            OnChangedActivation?.Invoke(this, EventArgs.Empty);
        }
    }
Beispiel #9
0
    /// <summary>
    /// Intermediary function used for networking the call of OnActivated
    /// </summary>
    private void Trigger(int id)
    {
        ButtonReactions buttonReactions = GetComponent <ButtonReactions>();

        if (buttonReactions)
        {
            buttonReactions.cachedID = id;
        }

        OnActivated.Invoke();
    }
Beispiel #10
0
    public override IEnumerator SkillRoutine(CustomCharacterController cc, Vector3 origin)
    {
        yield return(new WaitForSeconds(0.5f));

        Sequence s = DOTween.Sequence();

        //Move To Enemy
        Vector3 movePoint = new Vector3(enemy.transform.position.x - targetOffset, enemy.transform.position.y, enemy.transform.position.z);

        s.Append(actor.transform.DOMove(movePoint, moveToDuration));
        yield return(new WaitForSeconds(moveToDuration));

        //Wind Up
        Vector3 rotate = new Vector3(windUp - actor.transform.rotation.x, 90, 0);

        s.Append(actor.transform.DORotate(rotate, windUpDuration));
        s.Append(actor.transform.DOPunchScale(new Vector3(2, 2, 2), windUpDuration, 5, 0.5f));
        yield return(new WaitForSeconds(windUpDuration));

        //Slam
        rotate = new Vector3(slam + actor.transform.rotation.x, 90, 0);
        s.Append(actor.transform.DORotate(rotate, slamDuration));

        DealDamage(enemy, Damage);

        //Add Bleed buff to enemy
        BuffReciever bReceiver = enemy.GetComponent <BuffReciever>();

        if (bReceiver.FindBuff(_BleedDebuff) == false)
        {
            bReceiver.AddBuff(_BleedDebuff);
        }
        else
        {
            bReceiver.FindBuff(_BleedDebuff).duration = _BleedDebuff.duration;
        }

        OnActivated.Invoke();

        if (audioManager)
        {
            audioManager.PlaySFX("Hit");
        }

        yield return(new WaitForSeconds(slamDuration));

        s.Append(actor.transform.DORotate(new Vector3(0, 90, 0), 0.1f));
        movePoint = origin;
        s.Append(actor.transform.DOMove(movePoint, returnDuration).OnComplete(SkillEffectEnd));
        yield return(new WaitForSeconds(returnDuration));

        cc.OnDestinationReach.Invoke();
    }
Beispiel #11
0
    public override void SkillEffectEnd()
    {
        CustomCharacterController characterController = actor.GetComponent <CustomCharacterController>();

        //To Give listener that damage is done
        OnActivated.Invoke();
        characterController.OnDestinationReach.Invoke();

        //CameraShake camShake = Camera.main.GetComponent<CameraShake>();
        //camShake.CameraShakeByDefault();
        base.SkillEffectEnd();
    }
Beispiel #12
0
        protected virtual void Activate()
        {
            _isActive = !_isActive;

            // Change the active sprite of the object.
            Sprite currentSprite = _isActive ? activeSprite : inactiveSprite;

            outlineRenderer.sprite = currentSprite;
            _spriteRenderer.sprite = currentSprite;

            OnActivated?.Invoke(_isActive);
        }
Beispiel #13
0
    public IEnumerator SkillRoutine(Vector3 origin)
    {
        yield return(new WaitForSeconds(0.5f));

        Sequence s = DOTween.Sequence();

        s.Append(actor.transform.DOMoveY(riseRange, riseDuration));

        yield return(new WaitForSeconds(riseDuration));

        Vector3 rotate = new Vector3(0, 180, 0);

        s.Append(actor.transform.DOBlendableRotateBy(rotate, spinTime));
        s.Append(actor.transform.DOBlendableRotateBy(rotate, spinTime));
        s.Append(actor.transform.DOBlendableRotateBy(rotate, spinTime));
        s.Append(actor.transform.DOBlendableRotateBy(rotate, spinTime));
        if (audioManager)
        {
            audioManager.PlaySFX("Cast_Ice_Shield");
        }

        yield return(new WaitForSeconds(spinDuration));

        actor.GetComponent <Character>().Mana -= cost;

        //Buff Settings
        _DoubleAttackBuff.BaseValue = _Intensity.Levels[IntensityLevel - 1].IDatas.First();

        BuffReciever bReceiver = actor.GetComponent <BuffReciever>();

        if (bReceiver.FindBuff(_DoubleAttackBuff) == false)
        {
            bReceiver.AddBuff(_DoubleAttackBuff);
        }
        else
        {
            bReceiver.FindBuff(_DoubleAttackBuff).duration = _DoubleAttackBuff.duration;
        }

        s.Append(actor.transform.DOMove(origin, riseDuration));

        yield return(new WaitForSeconds(riseDuration));

        OnActivated.Invoke();
        base.SkillEffectEnd();
        actor.GetComponent <CustomCharacterController>().OnDestinationReach.Invoke();
    }
Beispiel #14
0
    private void OnTriggerEnter(Collider other)
    {
        WeightedObject o = other.GetComponent <WeightedObject>();

        if (o == null)
        {
            return;
        }
        bool wasActivated = Activated;

        activeObjects.Add(o.gameObject, o.Weight);
        AddObject(o);
        if (wasActivated != Activated)
        {
            OnActivated.Invoke();
        }
    }
Beispiel #15
0
 private void Start()
 {
     if (blurTrigger == null || blurMaskObject == null)
     {
         return;
     }
     blurTrigger.OnPointerEnterEvent += () =>
     {
         blurMaskObject.SetActive(true);
         OnActivated?.Invoke();
     };
     blurTrigger.OnPointerExitEvent += () =>
     {
         blurMaskObject.SetActive(false);
         OnDeactivated?.Invoke();
     };
 }
Beispiel #16
0
        public PhotoViewModel(IRouter router = null, IPhotosService service = null) : base(router)
        {
            Service = service ?? Locator.Current.GetService <IPhotosService>();
            var canLoadData = this.WhenAnyValue(vm => vm.Photo)
                              .Select(p => p != null);

            LoadPhotoData = ReactiveCommand.CreateAsyncTask(canLoadData, async o => await LoadPhotoDataImpl());
            photo         = OnActivated.Select(p => p.Photo)
                            .ToProperty(this, vm => vm.Photo);
            photoData = LoadPhotoData
                        .ObserveOn(RxApp.MainThreadScheduler)
                        .ToProperty(this, vm => vm.PhotoData);
            isLoading = LoadPhotoData.IsExecuting
                        .ObserveOn(RxApp.MainThreadScheduler)
                        .ToProperty(this, vm => vm.IsLoading);
            this.WhenAnyValue(vm => vm.Photo)
            .InvokeCommand(this, vm => vm.LoadPhotoData);
        }
Beispiel #17
0
    public override IEnumerator SkillRoutine(CustomCharacterController cc, Vector3 origin)
    {
        yield return(new WaitForSeconds(0.5f));

        Sequence s = DOTween.Sequence();

        Vector3 movePoint = new Vector3(enemy.transform.position.x - targetOffSet, enemy.transform.position.y, enemy.transform.position.z);

        s.Append(actor.transform.DOMove(movePoint, travelDuration));

        yield return(new WaitForSeconds(travelDuration));

        SpawnShield();
        yield return(new WaitForSeconds(spawnDuration));

        Vector3 rotate = new Vector3(windUp - actor.transform.rotation.x, 90, 0);

        s.Append(actor.transform.DORotate(rotate, windUpDuration));
        s.Append(actor.transform.DOPunchScale(new Vector3(2, 2, 2), windUpDuration, 5, 0.5f));
        yield return(new WaitForSeconds(windUpDuration));

        //Slam
        rotate       = new Vector3(slam + actor.transform.rotation.x, 90, 0);
        shieldTarget = enemy.transform.position;
        s.Append(actor.transform.DORotate(rotate, slamDuration).OnStart(MoveShield));

        DealDamage(enemy, Damage);
        OnActivated.Invoke();
        Quaternion rotation = Quaternion.Euler(-90, 0, 0);

        yield return(new WaitForSeconds(slamDuration));

        s.Append(actor.transform.DORotate(new Vector3(0, 90, 0), 0.1f));

        yield return(new WaitForSeconds(0.1f));

        //DestroyShield();
        movePoint = origin;
        s.Append(actor.transform.DOMove(movePoint, returnDuration).OnComplete(SkillEffectEnd));
        yield return(new WaitForSeconds(returnDuration));

        actor.GetComponent <CustomCharacterController>().OnDestinationReach.Invoke();
    }
Beispiel #18
0
    //TODO: Change this to something more flexible
    public IEnumerator SkillRoutine(CustomCharacterController cc, Vector3 origin)
    {
        //Move towards
        yield return(new WaitForSeconds(0.5f));

        Sequence s = DOTween.Sequence();

        s.Append(actor.transform.DOMoveY(riseRange, riseDuration));
        yield return(new WaitForSeconds(riseDuration));

        //Move To Enemy
        Vector3 movePoint = new Vector3(enemy.transform.position.x - targetOffset, enemy.transform.position.y, enemy.transform.position.z);

        s.Append(actor.transform.DOMove(movePoint, moveToDuration));
        yield return(new WaitForSeconds(moveToDuration));

        //Wind Up
        Vector3 rotate = new Vector3(windUp - actor.transform.rotation.x, -90, 0);

        s.Append(actor.transform.DORotate(rotate, windUpDuration));
        s.Append(actor.transform.DOPunchScale(new Vector3(2, 2, 2), windUpDuration, 5, 0.5f));
        yield return(new WaitForSeconds(windUpDuration));

        //Slam
        rotate = new Vector3(slam + actor.transform.rotation.x, -90, 0);
        s.Append(actor.transform.DORotate(rotate, slamDuration));

        DealDamage(enemy, damage);
        OnActivated.Invoke();

        Quaternion rotation       = Quaternion.Euler(-90, 0, 180);
        GameObject effectInstance = Instantiate(slashEffect, actor.transform.position + (Vector3.up * animYOffset), rotation);

        yield return(new WaitForSeconds(slamDuration));

        s.Append(actor.transform.DORotate(new Vector3(0, -90, 0), 0.1f));
        movePoint = origin;
        s.Append(actor.transform.DOMove(movePoint, returnDuration).OnComplete(SkillEffectEnd));
        yield return(new WaitForSeconds(returnDuration));

        actor.GetComponent <CustomCharacterController>().OnDestinationReach.Invoke();
    }
Beispiel #19
0
        /// <summary>
        ///     Activate this switch
        /// </summary>
        /// <remarks>
        ///     Invokes Deactivate after SwitchResetTime
        /// </remarks>
        /// <param name="player">The player that activates this switch</param>
        /// <returns></returns>
        public async Task Activate(Player player)
        {
            if (State)
            {
                return;
            }

            Activator = player;

            State = true;

            GameObject.Serialize(GameObject);

            await OnActivated.InvokeAsync(player);

            var _ = Task.Run(async() =>
            {
                await Task.Delay(SwitchResetTime * 1000);

                await Deactivate();
            });
        }
Beispiel #20
0
    public virtual IEnumerator SkillRoutine(CustomCharacterController cc, Vector3 origin)
    {
        //Move towards
        cc.destination = (enemy.transform.position);
        cc.stopRange   = 1;
        while (true)
        {
            if (Vector3.Distance(cc.transform.position, enemy.transform.position) <= cc.stopRange)
            {
                DealDamage(enemy, IntensityLevel);
                OnActivated.Invoke();
                break;
            }
            yield return(null);
        }
        CameraShake camShake = Camera.main.GetComponent <CameraShake>();

        camShake.CameraShakeByDefault();

        //Move Back
        cc.destination = (origin);
        cc.OnDestinationReach.AddListener(SkillEffectEnd);
    }
Beispiel #21
0
        public void Update()
        {
            entityCache.GetAwaitingActivation().ForEach(entity =>
            {
                var attrs       = entityAttributes[entity.Id.Index];
                attrs.Activated = true;
                OnActivated?.Invoke(this, new EntityEventArgs()
                {
                    Entity = entity
                });
            });

            entityCache.GetAwaitingDeactivation().ForEach(entity =>
            {
                var attrs       = entityAttributes[entity.Id.Index];
                attrs.Activated = false;
                OnDeactivated?.Invoke(this, new EntityEventArgs()
                {
                    Entity = entity
                });
            });

            entityCache.GetZombies().ForEach(entity =>
            {
                OnDestroy?.Invoke(this, new EntityEventArgs()
                {
                    Entity = entity
                });
                entity.Destroy();
                entityCache.RemoveAlive(entity);
                entityAttributes.Remove(entity.Id.Index);
                entityComponents.Remove(entity.Id.Index);
                entityIdPool.Remove(entity.Id);
            });

            entityCache.ClearTemp();
        }
        private void OnMouseDown(MouseDownEvent evt)
        {
            if (_active)
            {
                evt.StopImmediatePropagation();
                return;
            }

            if (!target.ContainsPoint(evt.localMousePosition) || !CanStartManipulation(evt))
            {
                return;
            }

            if (_moveTarget == null)
            {
                _moveTarget = target;
            }


            if (_snapCenterToMouse)
            {
                StartPosition = new Vector2(_moveTarget.layout.width * 0.5f, _moveTarget.layout.height * 0.5f);
                Vector2 position = _moveTarget.ChangeCoordinatesTo(_moveTarget.parent, target.ChangeCoordinatesTo(_moveTarget, evt.localMousePosition) - StartPosition);
                _moveTarget.style.left = position.x;
                _moveTarget.style.top  = position.y;
            }
            else
            {
                StartPosition = target.ChangeCoordinatesTo(_moveTarget, evt.localMousePosition);
            }

            _active = true;
            target.CaptureMouse();
            OnActivated?.Invoke(evt);
            evt.StopPropagation();
        }
Beispiel #23
0
        internal override void ApplyOwner(IDocumentEssential owner)
        {
            Owner = owner;
            SetTextProperties(Font, FontColor);

            if (OnMouseEnter != null)
            {
                OnMouseEnter.ApplyOwner(owner);
            }
            if (OnMouseExit != null)
            {
                OnMouseExit.ApplyOwner(owner);
            }
            if (OnMouseDown != null)
            {
                OnMouseDown.ApplyOwner(owner);
            }
            if (OnMouseUp != null)
            {
                OnMouseUp.ApplyOwner(owner);
            }
            if (OnReceiveFocus != null)
            {
                OnReceiveFocus.ApplyOwner(owner);
            }
            if (OnLoseFocus != null)
            {
                OnLoseFocus.ApplyOwner(owner);
            }
            if (OnPageOpen != null)
            {
                OnPageOpen.ApplyOwner(owner);
            }
            if (OnPageClose != null)
            {
                OnPageClose.ApplyOwner(owner);
            }
            if (OnPageVisible != null)
            {
                OnPageVisible.ApplyOwner(owner);
            }
            if (OnPageInvisible != null)
            {
                OnPageInvisible.ApplyOwner(owner);
            }
            if (OnKeyPressed != null)
            {
                OnKeyPressed.ApplyOwner(owner);
            }
            if (OnBeforeFormatting != null)
            {
                OnBeforeFormatting.ApplyOwner(owner);
            }
            if (OnChange != null)
            {
                OnChange.ApplyOwner(owner);
            }
            if (OnOtherFieldChanged != null)
            {
                OnOtherFieldChanged.ApplyOwner(owner);
            }
            if (OnActivated != null)
            {
                OnActivated.ApplyOwner(owner);
            }
        }
 public void NotifyOnActivated()
 {
     OnActivated?.Invoke(this);
 }
 public virtual void Activate()
 {
     Activated = true;
     OnActivated?.Invoke();
 }
Beispiel #26
0
 public static void CallOnActivation(int id)
 {
     OnActivated?.Invoke(id);
 }
Beispiel #27
0
 protected void InvokeActivated()
 {
     OnActivated?.Invoke();
 }
Beispiel #28
0
 private void Activated(object sender, System.EventArgs args)
 {
     Input.Input.Instance?.OnGameActivated();
     OnActivated?.Invoke();
 }
Beispiel #29
0
    public override IEnumerator SkillRoutine(CustomCharacterController cc, Vector3 origin)
    {
        yield return(new WaitForSeconds(0.5f));

        string sound;

        int rng = Random.Range(0, 100);

        if (rng == 0)
        {
            sound = "Spoof_BackStab";
        }
        else
        {
            sound = "Disappear_BackStab";
        }

        Sequence s = DOTween.Sequence();

        s.Append(actor.transform.DOMoveY(riseRange, riseDuration).OnComplete(DisappearParticle));
        yield return(new WaitForSeconds(riseDuration));

        if (audioManager)
        {
            audioManager.PlaySFX(sound);
        }

        actor.transform.position = new Vector3(enemy.transform.position.x + targetOffset, enemy.transform.position.y, enemy.transform.position.z);
        actor.transform.rotation = Quaternion.Euler(0, -90, 0);

        AppearParticle();

        Vector3 rotate = new Vector3(windUp - actor.transform.rotation.x, -90, 0);

        s.Append(actor.transform.DORotate(rotate, windUpDuration));
        s.Append(actor.transform.DOPunchScale(new Vector3(2, 2, 2), windUpDuration, 5, 0.5f));
        yield return(new WaitForSeconds(windUpDuration));

        rotate = new Vector3(slam + actor.transform.rotation.x, -90, 0);
        s.Append(actor.transform.DORotate(rotate, slamDuration));

        DealDamage(enemy, Damage);
        OnActivated.Invoke();

        yield return(new WaitForSeconds(slamDuration));

        yield return(new WaitForSeconds(0.2f));

        s.Append(actor.transform.DORotate(new Vector3(0, -90, 0), retunrDuration).OnComplete(DisappearParticle));
        yield return(new WaitForSeconds(retunrDuration));

        if (audioManager)
        {
            audioManager.PlaySFX(sound);
        }

        SkillEffectEnd();
        yield return(new WaitForSeconds(0.2f));

        actor.transform.position = origin;
        actor.transform.rotation = Quaternion.Euler(0, 90, 0);
        yield return(new WaitForSeconds(0.2f));

        actor.GetComponent <CustomCharacterController>().OnDestinationReach.Invoke();
        AppearParticle();
    }
 void OnEnable()
 {
     _collider.enabled = false;
     OnActivated?.Invoke(this.gameObject);
     _currentHealth = _startingHealth;
 }