Example #1
0
    protected virtual void PuzzleMoveAnim()
    {
        float   _targetX  = MovePos.Value.x / DefineClass.PuzzleXSize;
        float   _targetY  = MovePos.Value.y / DefineClass.PuzzleYSize;
        Vector3 targetPos = MovePos.Value;

        targetPos.x  = x;
        targetPos.y += DefineClass.PuzzleYSize;
        if (targetPos.y != GetPos().y)
        {
            Anime.Play(GetPos(), targetPos, Motion.Uniform(DefineClass.PuzzleDropAnimVel * (y - _targetY)))
            .SubscribeToLocalPosition(gameObject).AddTo(this);
        }

        Observable.Interval(TimeSpan.FromSeconds(DefineClass.PuzzleDropAnimVel * (_targetY - y))).First().Subscribe(x =>
        {
            Anime.Play(GetPos(), MovePos.Value, Motion.Uniform(DefineClass.PuzzleDropAnimVel))
            .Subscribe(_ =>
            {
                transform.localPosition = _;
                if (GetPos() == MovePos.Value)
                {
                    PuzzleManager.instance.puzzleArray[y, x] = null;
                    x = (int)_targetX;
                    y = (int)_targetY;
                    PuzzleManager.instance.puzzleArray[y, x] = this;
                }
            }).AddTo(this);
        }).AddTo(this);
    }
Example #2
0
 protected virtual void PuzzleChangeAnim(PuzzleBaseItemObj _target)
 {
     Anime.Play(transform.localPosition, _target.GetPos(), Motion.Uniform(DefineClass.PuzzleItemChangeAnimVel))
     .Subscribe(_ =>
     {
         transform.localPosition = _;
         if (transform.localPosition == _target.transform.localPosition)
         {
             PuzzleManager.instance.DestroyPuzzleItem();
         }
     });
 }
Example #3
0
 public virtual void DestroyPuzzleItem()
 {
     Anime.Play(transform.localScale, DefineClass.Vector3Zero, Motion.Uniform(DefineClass.PuzzleItemDestroyAnimVel))
     .Subscribe(_ =>
     {
         transform.localScale = _;
         if (transform.localScale == DefineClass.Vector3Zero)
         {
             PuzzleManager.instance.puzzleArray[y, x] = null;
             PoolManager.instance.puzzlePool.Return(this);
         }
     });
 }
Example #4
0
    public void addTimePop(PopUpInfo _info, bool _bBackGround, PopUpObj _obj = null)
    {
        PopUpBase popUpBase = make_PopUp(_info, _bBackGround, _obj);

        GameObject popObj = popUpBase.gameObject;

        Anime.Play(DefineClass.Vector3One3, DefineClass.Vector3One, Motion.Uniform(DefineClass.PopUpPunchAnimVel))
        .Subscribe(_ => popObj.transform.localScale = _).AddTo(this);

        Observable.Interval(TimeSpan.FromSeconds(DefineClass.PopUpTime)).First().Subscribe(_ =>
        {
            m_PopBackGround.SetActive(false);
            popUpBase.BackPopUp();
        }).AddTo(this);
    }