コード例 #1
0
        public override int GetHashCode()
        {
            var hashCode = -81208087;

            hashCode = hashCode * -1521134295 + Color.GetHashCode();
            hashCode = hashCode * -1521134295 + PushReaction.GetHashCode();
            hashCode = hashCode * -1521134295 + BlocksMovement.GetHashCode();
            hashCode = hashCode * -1521134295 + Flammable.GetHashCode();
            hashCode = hashCode * -1521134295 + RequiresNoTool.GetHashCode();
            hashCode = hashCode * -1521134295 + Liquid.GetHashCode();
            hashCode = hashCode * -1521134295 + Opaque.GetHashCode();
            hashCode = hashCode * -1521134295 + Replaceable.GetHashCode();
            hashCode = hashCode * -1521134295 + Solid.GetHashCode();
            return(hashCode);
        }
コード例 #2
0
ファイル: InputController.cs プロジェクト: YHSSSS/Clone2048
    private void Start()
    {
        movement = GameObject.Find("GridPart").GetComponent <BlocksMovement>();
        if (!movement)
        {
            Debug.LogError("Failed to find grid part and get blocks movement component");
        }

        isSwiped = false;

        //Check if the screen is portrait.
        if (Screen.width < Screen.height)
        {
            //Using the width of the screen to calculate the minimum length of swiping distance.
            minSwipeDistX = Screen.width / minSwipeNumber;
            minSwipeDistY = Screen.width / minSwipeNumber;
        }
        else
        {
            //Using the height of the screen to calculate the minimum length of swiping distance.
            minSwipeDistX = Screen.height / minSwipeNumber;
            minSwipeDistY = Screen.height / minSwipeNumber;
        }
    }