예제 #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;
        }
예제 #2
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();
    }
예제 #3
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();
    }
예제 #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();
    }
예제 #5
0
    void UpdateInteraction()
    {
        if (!Active) return;

        if (Input.GetKeyDown(KeyCode.Space) || AutoInteract)
            if (OnActivated != null)
                OnActivated.Invoke();
    }
 public static void OnActivatedInternal(string args, NotificationUserInput input, string aumid)
 {
     OnActivated?.Invoke(new NotificationActivatiedEventArgs()
     {
         Arguments = args,
         UserInput = input
     });
 }
예제 #7
0
    public void Interact(PlayerInteraction _player)
    {
        if (player == null)
        {
            player = _player.GetComponent <Player>();
            player.PlayerStatus.isInteracting = true;
            player.PlayerStatus.CanWalk       = false;
            onActivated.Invoke(true);
        }

        else
        {
            player.PlayerStatus.isInteracting = false;
            player.PlayerStatus.CanWalk       = true;
            player = null;
            onActivated.Invoke(false);
        }
    }
    // Trigger activation events
    public void TriggerActivated()
    {
        OnActivated?.Invoke(this, EventArgs.Empty);

        if (!IsActive)
        {
            IsActive = true;
            OnChangedActivation?.Invoke(this, EventArgs.Empty);
        }
    }
예제 #9
0
파일: DropZone.cs 프로젝트: Njz2587/Citadel
    /// <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();
    }
예제 #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();
    }
예제 #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();
    }
예제 #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);
        }
예제 #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();
    }
예제 #14
0
 private void Start()
 {
     if (blurTrigger == null || blurMaskObject == null)
     {
         return;
     }
     blurTrigger.OnPointerEnterEvent += () =>
     {
         blurMaskObject.SetActive(true);
         OnActivated?.Invoke();
     };
     blurTrigger.OnPointerExitEvent += () =>
     {
         blurMaskObject.SetActive(false);
         OnDeactivated?.Invoke();
     };
 }
예제 #15
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();
        }
    }
예제 #16
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();
    }
예제 #17
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();
    }
예제 #18
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);
    }
예제 #19
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();
        }
예제 #20
0
        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();
        }
 public virtual void Activate()
 {
     Activated = true;
     OnActivated?.Invoke();
 }
예제 #22
0
 protected void InvokeActivated()
 {
     OnActivated?.Invoke();
 }
예제 #23
0
 public void NotifyOnActivated()
 {
     OnActivated?.Invoke(this);
 }
예제 #24
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();
    }
예제 #25
0
 void OnEnable()
 {
     _collider.enabled = false;
     OnActivated?.Invoke(this.gameObject);
     _currentHealth = _startingHealth;
 }
예제 #26
0
 public static void CallOnActivation(int id)
 {
     OnActivated?.Invoke(id);
 }
예제 #27
0
 private void Activated(object sender, System.EventArgs args)
 {
     Input.Input.Instance?.OnGameActivated();
     OnActivated?.Invoke();
 }