Beispiel #1
0
    private void Update()
    {
        if (!_Enter)
        {
            if (_Last_Chest != null)
            {
                _Last_Chest.Move(C_V2(_Point_OUT.transform.position), _Speed);
            }
            if (_List_Chest.Count < 4)
            {
                CreateChest();
            }
        }
        else
        {
            if (_Last_Chest != null)
            {
                _Last_Chest.Move(C_V2(_Point_IN.transform.position), _Speed);
            }
            Chest_Conv BUF = _List_Chest.Find(A => A._Is_MoveEnd(C_V2(_Point_IN.transform.position)));

            if (BUF != null)
            {
                DeleteChest(BUF.Obj);
                S_A_GameRoom.GetInstance().DestroyChest(BUF.Obj);


                if (_List_Chest.Count == 0)
                {
                    _Last_Chest = null;
                }
            }
        }

        if (_Last_Chest != null)
        {
            if (_Enter)
            {
                _Mesh.material.SetFloat("_ScrollYSpeed", -_Speed * KOF_SP_CON);
            }
            else
            {
                _Mesh.material.SetFloat("_ScrollYSpeed", _Speed * KOF_SP_CON);
            }
        }
        else
        {
            _Mesh.material.SetFloat("_ScrollYSpeed", 0);
        }
    }
Beispiel #2
0
        public void Move(Vector2 Point_OUT_, float Speed_)
        {
            float Dis2 = Vector2.Distance(C_V2(Obj.transform.position), Point_OUT_);

            Obj._Enable = Dis2 < 0.05f;

            if (Parens == null)
            {
                Vector2 VEC = Point_OUT_ - C_V2(Obj.transform.position);
                if (VEC.magnitude > 0.025f)
                {
                    Obj.transform.Translate(C_V3(VEC.normalized) * Speed_ * 0.02f, Space.World);
                }
                return;
            }

            float Dis = Vector2.Distance(C_V2(Obj.transform.position), C_V2(Parens.Obj.transform.position));

            if (Dis > (Parens.Obj.Container_Size + Obj.Container_Size) * 0.5f)
            {
                Vector2 VEC = Point_OUT_ - C_V2(Obj.transform.position);
                Obj.transform.Translate(C_V3(VEC.normalized) * Speed_ * 0.02f, Space.World);
            }

            Parens.Move(Point_OUT_, Speed_);
        }