Пример #1
0
    private void OnDragStart()
    {
        GameObject targetObject = GetCurrentTarget();

        removeableBallList.Clear();

        if (targetObject)
        {
            if (targetObject.name.IndexOf("Ball") != -1)
            {
                firstBall = targetObject.GetComponent <CommonBall>();

                removeableBallList.Add(targetObject);

                firstBall.isAdd = true;

                ChangeColor(targetObject);
            }
        }
    }
Пример #2
0
    private void OnDragging()
    {
        GameObject targetObject = GetCurrentTarget();

        if (targetObject)
        {
            if (targetObject.name.IndexOf("Ball") != -1)
            {
                CommonBall targetBall = targetObject.transform.GetComponent <CommonBall>();

                if (targetBall.kindOfId == firstBall.kindOfId)
                {
                    if (targetBall.isAdd == false)
                    {
                        removeableBallList.Add(targetObject);

                        targetBall.isAdd = true;

                        ChangeColor(targetObject);
                    }
                }
            }
        }
    }